Commit graph motorino/internal/build/build.go
Author SHA1 Message Date
tgiachi
52edb15b64 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
4a501d77b3 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
26edf78449 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
tgiachi
eb2a8dc9b4 feat: take the menu from the site, not from the code
The menu entries were three lists in Go (the menu, the linked pages and
the required pages), so a new menu entry meant a new motorino release.
Now every page ID gets url_<id> and cur_<id> for the templates, and
header.html alone decides what is in the menu and in which order. Only
the home page and the news section stay required, since motorino builds
them itself.

Output of the real kmalloc.org site is byte for byte the same as 1.1.0.
2026-11-15 18:08:42 +01:00
tgiachi
1505e5d782 feat(nav): add an optional projects page to the menu
kmalloc.org wants a "Projects" entry between People and Services,
linking to a page listing the software it currently builds. Adds
"projects" to the menu, the linked pages and the required pages, and
keeps the test fixtures (and the main_test page count) in sync.
2026-11-15 17:44:40 +01:00
tgiachi
917683afa4 fix: close the minor findings of the first review
Require refuses an empty value. Heading ids: an explicit {#id} must be sound
and unique, generated ids avoid the explicit ones and each other, and a heading
with no ASCII letters gets a fallback. Fenced code blocks keep their
placeholders and a backslash keeps one anywhere. The em dash rule covers the
header of the manifesto pages and the HTML entities. The feed makes src links
absolute, base_url is required, and the news page must be a folder index. A
category written twice in a post counts once, a block name in a news title is no
longer taken for a placeholder, and build refuses extra arguments.
2026-11-15 10:32:19 +01:00
tgiachi
1298a98f30 fix: escape the title attribute, refuse clashing addresses and unsafe paths, check Switch
A quote in a title broke the og:title attribute (a regression from build.py).
Two sources that give the same output address now stop the build and name
both, instead of one replacing the other. Asset names and sources must be
paths inside the site, language codes must look like codes, and the Switch key
is escaped, must point to a path and may name only listed languages.
2026-11-15 10:03:58 +01:00
tgiachi
2c3975430b feat: add the build and version commands 2026-11-15 09:51:52 +01:00
tgiachi
6bdf2ca05f feat: assemble the site from content, templates and assets 2026-11-15 09:50:58 +01:00