From 85b01cf5883f07953edcc326d0cc64d5de8fa9e8 Mon Sep 17 00:00:00 2001 From: squid Date: Mon, 16 Nov 2026 12:12:27 +0100 Subject: [PATCH] feat(news): news in blog style Templates and strings for the blog features of the next motorino: a post page with the long date, author, categories, summary, reading time and links to the older and newer posts, the blog list with pages and the archive on the news index, Open Graph article meta, month names and the interface strings in the five languages, the author and the language of the news in site.json, and the styles. Needs the motorino release that adds these features (.motorino-version is not changed here). --- content/en/news/index.md | 6 +++++- lang/de.json | 28 +++++++++++++++++++++++++++- lang/en.json | 28 +++++++++++++++++++++++++++- lang/es.json | 28 +++++++++++++++++++++++++++- lang/fr.json | 28 +++++++++++++++++++++++++++- lang/it.json | 28 +++++++++++++++++++++++++++- site.json | 2 ++ static/style.css | 33 +++++++++++++++++++++++++++++++++ templates/archive.html | 5 +++++ templates/base.html | 3 ++- templates/post.html | 9 ++++++--- 11 files changed, 188 insertions(+), 10 deletions(-) create mode 100644 templates/archive.html diff --git a/content/en/news/index.md b/content/en/news/index.md index 137c96e..19b5b77 100644 --- a/content/en/news/index.md +++ b/content/en/news/index.md @@ -7,10 +7,14 @@ Layout: bare Updates from kmalloc.org. -{{news_list}} +{{news_blog}} ## Categories {#categories} {{categories_list}} +## Archive {#archive} + +{{news_archive}} + [RSS feed](/news/feed.xml) diff --git a/lang/de.json b/lang/de.json index d03cc92..5884a7e 100644 --- a/lang/de.json +++ b/lang/de.json @@ -18,5 +18,31 @@ "news": "News" }, "powered_by": "Powered by", - "category_h": "Category" + "category_h": "Category", + "date_long": "{d}. {month} {y}", + "date_month_year": "{month} {y}", + "reading_time": "{n} Min. Lesezeit", + "post_older": "Älter", + "post_newer": "Neuer", + "post_nav": "Weitere News", + "reply_mastodon": "Auf Mastodon antworten", + "read_more": "Weiterlesen", + "pager_label": "News-Seiten", + "pager_newer": "Neuere News", + "pager_older": "Ältere News", + "pager_page": "Seite {n} von {total}", + "archive_h": "Archiv", + "archive_up": "Archiv des Jahres", + "month_01": "Januar", + "month_02": "Februar", + "month_03": "März", + "month_04": "April", + "month_05": "Mai", + "month_06": "Juni", + "month_07": "Juli", + "month_08": "August", + "month_09": "September", + "month_10": "Oktober", + "month_11": "November", + "month_12": "Dezember" } diff --git a/lang/en.json b/lang/en.json index 679a91a..5a7c240 100644 --- a/lang/en.json +++ b/lang/en.json @@ -22,5 +22,31 @@ "news": "News" }, "powered_by": "Powered by", - "category_h": "Category" + "category_h": "Category", + "date_long": "{d} {month} {y}", + "date_month_year": "{month} {y}", + "reading_time": "{n} min read", + "post_older": "Older", + "post_newer": "Newer", + "post_nav": "More news", + "reply_mastodon": "Reply on Mastodon", + "read_more": "Read more", + "pager_label": "News pages", + "pager_newer": "Newer news", + "pager_older": "Older news", + "pager_page": "Page {n} of {total}", + "archive_h": "Archive", + "archive_up": "Archive of the year", + "month_01": "January", + "month_02": "February", + "month_03": "March", + "month_04": "April", + "month_05": "May", + "month_06": "June", + "month_07": "July", + "month_08": "August", + "month_09": "September", + "month_10": "October", + "month_11": "November", + "month_12": "December" } diff --git a/lang/es.json b/lang/es.json index 58630cf..183fe51 100644 --- a/lang/es.json +++ b/lang/es.json @@ -18,5 +18,31 @@ "news": "News" }, "powered_by": "Powered by", - "category_h": "Category" + "category_h": "Category", + "date_long": "{d} de {month} de {y}", + "date_month_year": "{month} de {y}", + "reading_time": "{n} min de lectura", + "post_older": "Más antigua", + "post_newer": "Más reciente", + "post_nav": "Más noticias", + "reply_mastodon": "Responder en Mastodon", + "read_more": "Leer más", + "pager_label": "Páginas de noticias", + "pager_newer": "Noticias más recientes", + "pager_older": "Noticias más antiguas", + "pager_page": "Página {n} de {total}", + "archive_h": "Archivo", + "archive_up": "Archivo del año", + "month_01": "enero", + "month_02": "febrero", + "month_03": "marzo", + "month_04": "abril", + "month_05": "mayo", + "month_06": "junio", + "month_07": "julio", + "month_08": "agosto", + "month_09": "septiembre", + "month_10": "octubre", + "month_11": "noviembre", + "month_12": "diciembre" } diff --git a/lang/fr.json b/lang/fr.json index a54b130..1354310 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -18,5 +18,31 @@ "news": "News" }, "powered_by": "Powered by", - "category_h": "Category" + "category_h": "Category", + "date_long": "{d} {month} {y}", + "date_month_year": "{month} {y}", + "reading_time": "{n} min de lecture", + "post_older": "Plus ancien", + "post_newer": "Plus récent", + "post_nav": "Autres actualités", + "reply_mastodon": "Répondre sur Mastodon", + "read_more": "Lire la suite", + "pager_label": "Pages des actualités", + "pager_newer": "Actualités plus récentes", + "pager_older": "Actualités plus anciennes", + "pager_page": "Page {n} sur {total}", + "archive_h": "Archives", + "archive_up": "Archives de l'année", + "month_01": "janvier", + "month_02": "février", + "month_03": "mars", + "month_04": "avril", + "month_05": "mai", + "month_06": "juin", + "month_07": "juillet", + "month_08": "août", + "month_09": "septembre", + "month_10": "octobre", + "month_11": "novembre", + "month_12": "décembre" } diff --git a/lang/it.json b/lang/it.json index d6b181f..b9a7a08 100644 --- a/lang/it.json +++ b/lang/it.json @@ -22,5 +22,31 @@ "news": "News" }, "powered_by": "Powered by", - "category_h": "Categoria" + "category_h": "Categoria", + "date_long": "{d} {month} {y}", + "date_month_year": "{month} {y}", + "reading_time": "{n} min di lettura", + "post_older": "Più vecchia", + "post_newer": "Più recente", + "post_nav": "Altre news", + "reply_mastodon": "Rispondi su Mastodon", + "read_more": "Leggi tutto", + "pager_label": "Pagine delle news", + "pager_newer": "News più recenti", + "pager_older": "News meno recenti", + "pager_page": "Pagina {n} di {total}", + "archive_h": "Archivio", + "archive_up": "Archivio dell'anno", + "month_01": "gennaio", + "month_02": "febbraio", + "month_03": "marzo", + "month_04": "aprile", + "month_05": "maggio", + "month_06": "giugno", + "month_07": "luglio", + "month_08": "agosto", + "month_09": "settembre", + "month_10": "ottobre", + "month_11": "novembre", + "month_12": "dicembre" } diff --git a/site.json b/site.json index 235ba78..c4840d2 100644 --- a/site.json +++ b/site.json @@ -1,5 +1,7 @@ { "base_url": "https://kmalloc.org", + "news_language": "en", + "author": "squid", "languages": [ "en", "it", diff --git a/static/style.css b/static/style.css index 3b9c2ad..fc80741 100644 --- a/static/style.css +++ b/static/style.css @@ -131,6 +131,39 @@ code { gap: .5em; } +.lede { + margin: -.25em 0 1em; + color: var(--muted); + font-size: 1.125em; +} + +.meta { + margin-top: -.25em; + color: var(--muted); + font-size: .9375em; +} + +article { + margin: 1.5em 0; + padding-bottom: .5em; + border-bottom: 1px solid var(--border); +} + +article h2 { + margin: 0 0 .25em; + font-size: 1.25em; +} + +article p { + margin: .5em 0; +} + +nav ul { + margin: 1em 0; + padding: 0; + list-style: none; +} + @media print { :root { --bg: #FFF; diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..401c31d --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,5 @@ +

{{archive_h}}: {{archive_name}}

+ +{{archive_nav}} + +{{archive_posts}} diff --git a/templates/base.html b/templates/base.html index ba0a406..f40d963 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,9 +7,10 @@ - + +{{article_meta}} diff --git a/templates/post.html b/templates/post.html index 8a9a1aa..77f32ea 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,7 +1,10 @@

{{post_title}}

-

-{{post_byline}} -

+{{post_summary}} +{{post_meta}} {{post_body}} + +{{post_mastodon}} + +{{post_nav}}