Phase 5 part 1: read a site's section types and pages

Sites → Sections and pages reads the website's Hugo repository: each
section type with the README's description, the fields in use and the
layout's, the pages using it and a real example; the pages and their
sections; the latest commits. Working copies are now held by one job at a
time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 13:52:35 -07:00
co-authored by Claude Opus 5.5
parent 00e6deee00
commit 1152cd448b
15 changed files with 958 additions and 11 deletions
+8 -2
View File
@@ -9,8 +9,9 @@ import (
)
// Site makes a small Hugo site in a bare repository and returns its
// clone URL. Its titles are "Page title · Site".
func Site(t testing.TB) string {
// clone URL. Its titles are "Page title · Site". Extra files are added to
// (or replace) the site's own.
func Site(t testing.TB, extra ...map[string]string) string {
t.Helper()
dir := t.TempDir()
src := filepath.Join(dir, "src")
@@ -24,6 +25,11 @@ func Site(t testing.TB) string {
"content/blog/first-post/index.md": "+++\ntitle = \"First post\"\n+++\nHello.\n",
"content/about.md": "---\ntitle: About us\nurl: /company/\n---\nWho we are.\n",
}
for _, e := range extra {
for name, body := range e {
files[name] = body
}
}
for name, body := range files {
p := filepath.Join(src, name)
os.MkdirAll(filepath.Dir(p), 0o755)