From 1505e5d7820a3b6f24a0f2a2ea8c8dc29219436d Mon Sep 17 00:00:00 2001 From: tgiachi Date: Sun, 15 Nov 2026 17:44:40 +0100 Subject: [PATCH 1/2] 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. --- cmd/motorino/main_test.go | 4 ++-- internal/build/build.go | 2 +- internal/build/context.go | 4 ++-- internal/build/fixture_test.go | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/motorino/main_test.go b/cmd/motorino/main_test.go index 4090294..cd8f08a 100644 --- a/cmd/motorino/main_test.go +++ b/cmd/motorino/main_test.go @@ -28,7 +28,7 @@ func miniSite(t *testing.T) string { "templates/pages/page.html": "

{{page_title}}

{{body}}\n", "templates/post.html": "{{post_body}}\n", "templates/category.html": "{{category_posts}}\n", } - for _, id := range []string{"home", "manifesto", "people", "services", "news", "history"} { + for _, id := range []string{"home", "manifesto", "people", "projects", "services", "news", "history"} { name := id switch id { case "home": @@ -71,7 +71,7 @@ func TestRunBuildSuccess(t *testing.T) { if code != 0 { t.Fatalf("run(build) = %d, stderr %q", code, errOut.String()) } - if want := "built 6 pages into " + outDir; !strings.Contains(out.String(), want) { + if want := "built 7 pages into " + outDir; !strings.Contains(out.String(), want) { t.Errorf("output %q does not contain %q", out.String(), want) } if _, err := os.Stat(filepath.Join(outDir, "index.html")); err != nil { diff --git a/internal/build/build.go b/internal/build/build.go index a6d2ea3..d43a902 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -28,7 +28,7 @@ type Options struct { // requiredPages are the IDs every site must have in its default language, // because the menu and the footer link to them. -var requiredPages = []string{"home", "manifesto", "people", "services", "news", "history"} +var requiredPages = []string{"home", "manifesto", "people", "projects", "services", "news", "history"} // newsOnHome is how many news the home page lists; feedLimit is how many the feed has. const ( diff --git a/internal/build/context.go b/internal/build/context.go index 0b4d7df..a46a049 100644 --- a/internal/build/context.go +++ b/internal/build/context.go @@ -10,10 +10,10 @@ import ( ) // menuPages are the IDs of the pages in the menu; the current one is marked. -var menuPages = []string{"home", "manifesto", "people", "services", "news"} +var menuPages = []string{"home", "manifesto", "people", "projects", "services", "news"} // linkedPages are the IDs the templates link to with url_. -var linkedPages = []string{"manifesto", "people", "services", "news", "history"} +var linkedPages = []string{"manifesto", "people", "projects", "services", "news", "history"} // blockNames are the placeholders that expand to generated HTML. Until they // are expanded they stand for themselves, so a page can hold them. diff --git a/internal/build/fixture_test.go b/internal/build/fixture_test.go index 815888e..e02e0ac 100644 --- a/internal/build/fixture_test.go +++ b/internal/build/fixture_test.go @@ -94,12 +94,14 @@ func baseFiles() map[string]string { "content/en/manifesto.md": page("manifesto", "Manifesto", "Layout: manifesto\n", "## 01 — Antifascist\n\nText one.\n\n## Our commitments\n\nText two.\n"), "content/en/manifesto-history.md": page("history", "Manifesto history", "", "Versions.\n"), "content/en/people.md": page("people", "People", "", "## squid\n\nI run it.\n"), + "content/en/projects.md": page("projects", "Projects", "", "## motorino\n\nThis.\n"), "content/en/services.md": page("services", "Services", "Switch: it=/it/servizi.html\n", "Write to **{{contact_shown}}**.\n"), "content/en/news/index.md": page("news", "News", "", "{{news_list}}\n\n{{categories_list}}\n"), "content/it/index.md": page("home", "kmalloc.org", "Layout: bare\n", "{{latest_news}}\n"), "content/it/manifesto.md": page("manifesto", "Manifesto", "Layout: manifesto\n", "## 01 — Antifascisti\n\nTesto.\n"), "content/it/cronologia-manifesto.md": page("history", "Cronologia", "", "Versioni.\n"), "content/it/persone.md": page("people", "Persone", "", "Io.\n"), + "content/it/progetti.md": page("projects", "Progetti", "", "## motorino\n\nQuesto.\n"), "content/it/servizi.md": page("services", "Servizi", "", "Scrivi a {{contact_shown}}.\n"), "content/es/manifesto.md": page("manifesto", "Manifiesto", "Layout: manifesto\nNote: Traduccion de la version 1.0.\nManifestoVersion: 1.0\nManifestoDate: 2026-11-12\n", "## 01 — Antifascistas\n\nTexto.\n"), From d7f076659ae7b9c7a53ccd1b00a846d66134f09b Mon Sep 17 00:00:00 2001 From: tgiachi Date: Sun, 15 Nov 2026 17:44:50 +0100 Subject: [PATCH 2/2] chore(release): 1.1.0 [skip ci] ## [1.1.0](https://git.kmalloc.org/squid/motorino/compare/v1.0.1...v1.1.0) (2026-11-15) ### Features * add an optional projects page to the menu (1505e5d) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66ddd0a..2e89b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.1.0](https://git.kmalloc.org/squid/motorino/compare/v1.0.1...v1.1.0) (2026-11-15) + +### Features + +* add an optional projects page to the menu ([1505e5d](https://git.kmalloc.org/squid/motorino/commit/1505e5d)) + ## [1.0.1](https://git.kmalloc.org/squid/motorino/compare/v1.0.0...v1.0.1) (2026-11-15) ### Bug Fixes