News as blog posts: richer post page, blog list with pages, archives, drafts and motorino new #11

Merged
squid merged 8 commits from feat/blog-news into main 2026-11-16 11:55:35 +00:00

2026-11-16

tgiachi
feat(build): report the old files of the output folder, add -clean
All checks were successful
check / check (pull_request) Successful in 29s
A build never emptied the output folder, so the pages of a list that got shorter stayed
behind. The build now returns the files it did not write and the command prints a
warning that names them. -clean empties the folder first, only when it is new, empty or
holds the .motorino-out file that an earlier -clean left, and never the folder of the site
or one that holds it. The default is unchanged: no extra file in a folder built without it,
so the deploy (a new folder published with rsync --delete) is not affected.

Refs #9
2026-11-16 12:49:17 +01:00
tgiachi
fix(news): group the archive by the month as written, drop the empty lists
- groupArchive compared each post with the last group only, so two posts near midnight
  at the end of a month, written with different offsets, listed the same month twice and
  the build failed with "both published as". Posts are grouped by their own year and
  month, newest first.
- {{news_archive}} is empty when there are no posts, so the index says there is no news
  once, and the heading of an empty {{news_archive}} or {{categories_list}} goes with it.
- tests for exactly ten posts, eleven posts, a single post, a title with quotes, an
  ampersand, a tag and non Latin letters, and a neighbour written in another language

Refs #9
2026-11-16 12:48:17 +01:00
tgiachi
feat(news): show the posts of the lists as note panels
All checks were successful
check / check (pull_request) Successful in 30s
The blog list, the pages of a category and the pages of an archive show every post as a
note panel: a small line with the long date and the categories, the title in bold with
a full stop (unless it ends with a full stop, a question mark or an exclamation mark),
the description and a read more link whose aria-label names the post. The page of a
post, {{news_list}} and the latest news of the home page are unchanged.

A language without read_more gets the title as the link on the category and archive
pages, as those pages worked before; the blog list still needs the string.

Refs #9
2026-11-16 12:32:09 +01:00
tgiachi
feat: motorino new writes a draft, motorino build -drafts previews it
All checks were successful
check / check (pull_request) Successful in 30s
motorino new -site DIR "A title" writes news/a-title.md with the header ready:
the date of now, the author from site.json, the category News and Draft: true.
motorino build -drafts publishes the drafts and the posts dated in the future,
for a preview. The README describes the header keys, the news language, the blog
placeholders and blocks, and the language strings they use.

Refs #9
2026-11-16 12:10:30 +01:00
tgiachi
feat(feed): carry the full text in content:encoded
The description of an item is now the plain summary of the post, the full text with
absolute links goes in content:encoded (the end marker of a CDATA section inside
the text is split), and an item has its categories and its author (dc:creator).

Refs #9
2026-11-16 12:09:03 +01:00
tgiachi
feat(news): blog list with pages, and an archive by year and month
- {{news_blog}} lists the posts as entries (title, long date, categories,
  description, a read more link) 10 to a page; the other pages are written under
  the index, at page/2/, page/3/ and so on, with a pager.
- Archive pages for every year and month that has posts, at /news/2026/ and
  /news/2026/11/, when templates/archive.html exists, and a {{news_archive}} block.

Refs #9
2026-11-16 12:08:07 +01:00
tgiachi
feat(news): a post page with date, author, categories, summary and links
New placeholders for templates/post.html, written in the language of the post:
date_long, post_summary, post_meta, post_reading, post_mastodon and post_nav
(older, newer and all news), plus og_type and article_meta for Open Graph, which
every other page sets to website. A post with a Mastodon address needs the
reply_mastodon string; the other strings are optional and a feature without its
string is left out.

Refs #9
2026-11-16 12:06:55 +01:00
tgiachi
feat(news): hide drafts and future posts, give the news one language
- Draft: true and a date in the future keep a post out of the pages, the lists,
  the categories and the feed. motorino build -drafts (next commit) shows them.
- news_language in site.json, and an optional Language key in a post, choose the
  language of the news pages and of the interface strings they use. The news
  still exist once, not once per language.
- New header keys Mastodon (an https address), Draft and Language; a post knows
  its reading time and whether its description was written.

Refs #9
2026-11-16 12:04:50 +01:00