update @ Wed Dec 18 02:14:35 EET 2024

Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
Arija A. 2024-12-18 02:14:35 +02:00
parent a465d604af
commit 86c92034a7
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2
5 changed files with 61 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -69,7 +69,7 @@ blockquote:before {
} }
.media > img { .media > img {
max-width: 400px; max-width: 600px;
width: 100%; width: 100%;
height: auto; height: auto;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -11,5 +11,18 @@
"ext": "jpeg", "ext": "jpeg",
"mime": "image/jpeg", "mime": "image/jpeg",
"uploaded": 1734269521.436514 "uploaded": 1734269521.436514
},
"0867cea01b7f0dda58de112b78d19a2ef5b0c06102a8526b2157d14ec9e3db24": {
"type": "image",
"width": 1200,
"height": 630,
"alt": "The rust mascot next to text: \"Is rust worth it? (no, not really)\", on a black background",
"purpose": "Image preview for \"Rust Bad II\"",
"title": "Is rust worth it? (no, not really)",
"license": "CC-BY-SA-4.0",
"credit": "Ari Archer",
"ext": "png",
"mime": "image/png",
"uploaded": 1734473202.686761
} }
} }

View file

@ -162,7 +162,7 @@ DEFAULT_CONFIG: dict[str, typing.Any] = {
"top-words": 64, "top-words": 64,
"top-tags": 64, "top-tags": 64,
"code-style": "coffee", "code-style": "coffee",
"note": 'This page uses the <a href="https://github.com/ryanoasis/nerd-fonts">Nerd Hack Font</a>, which is licensed under the OFL 1.1 License. All internal content, unless specified otherwise, is subject to their respective license terms as well as <a href=\"https://ari.lt/legal\">Ari-web legal policies</a>.', "note": 'This page uses the <a href="https://github.com/ryanoasis/nerd-fonts">Nerd Hack Font</a>, which is licensed under the OFL 1.1 License. All internal content, unless specified otherwise, is subject to their respective license terms as well as <a href="https://ari.lt/legal">Ari-web legal policies</a>. Treat the content and the source of the page as source code according to the license.',
"posts": {}, "posts": {},
} }
@ -580,6 +580,11 @@ def select_posts(posts: dict[str, dict[str, typing.Any]]) -> tuple[str, ...]:
def select_medias(type: typing.Optional[str] = None) -> tuple[str, ...]: def select_medias(type: typing.Optional[str] = None) -> tuple[str, ...]:
if os.path.exists("media/media.json"):
with open("media/media.json", "r") as fp:
MEDIA_INDEX.clear()
MEDIA_INDEX.update(json.load(fp))
if type: if type:
return tuple( return tuple(
map( map(
@ -821,8 +826,9 @@ def parse_inline_media_embed(
{"type": "linebreak"}, {"type": "linebreak"},
{ {
"type": "emphasis", "type": "emphasis",
"raw": f"{mdx['alt']} | \"{mdx['title']}\" by {mdx['credit']} ({mdx['license']}). Purpose: {mistune.escape(mdx['purpose'])}. Uploaded on {datetime.datetime.utcfromtimestamp(mdx['uploaded']).strftime('%a, %d %b %Y %H:%M:%S GMT')}. ", "raw": f"{mdx['alt']} | \"{mdx['title']}\" by {mdx['credit']} ({mdx['license']}). Purpose: {mistune.escape(mdx['purpose'])}. Uploaded on {datetime.datetime.utcfromtimestamp(mdx['uploaded']).strftime('%a, %d %b %Y %H:%M:%S GMT')}.",
}, },
{"type": "text", "raw": " "},
{ {
"type": "link", "type": "link",
"children": [{"type": "text", "raw": f"(raw media here)"}], "children": [{"type": "text", "raw": f"(raw media here)"}],
@ -1766,7 +1772,15 @@ def media(config: dict[str, typing.Any]) -> int:
purpose: str = iinput("media purpose") purpose: str = iinput("media purpose")
title: str = iinput("media title") title: str = iinput("media title")
license: str = ", ".join(select_multi(licenses)) license: str = ", ".join(
select_multi(
[
"All-rights-reserved",
"Unknown",
]
+ licenses
)
)
credit: str = iinput("media credit") credit: str = iinput("media credit")