diff --git a/README.md b/README.md index 7c200c9d..9a89a197 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ Content pages are Markdown with YAML front matter and can be corrected by hand, make post NAME=my-title creates `content/post/-my-title.md` (any `.md` file in `content/post/` is a post). The -date comes from the file name unless `date:` is set; `author:` is optional. For a banner, put an +date comes from the file name unless `date:` is set; `author:` is optional; the name +links to `/author//`, which lists all posts by that author. For a banner, put an image under `static/media/` and set `banner: /media/....jpg`. Write the text in Markdown and remove `draft: true` to publish. The five most recent posts appear on the home page with their banner, date, author and summary (`summary:` in the front matter, or the text before diff --git a/hugo.toml b/hugo.toml index 66f5a25c..a9e05fa7 100644 --- a/hugo.toml +++ b/hugo.toml @@ -5,6 +5,8 @@ locale = "en" disableKinds = ["rss", "sitemap"] # pages keep working when the site is served from a sub-directory relativeURLs = true +# keep author names and taxonomy terms as written (olipix, not Olipix) +capitalizeListTitles = false # a post named 2026-10-11-my-title.md gets its date from the file name (and the URL /post/my-title/) [frontmatter] @@ -23,6 +25,8 @@ relativeURLs = true topic = "topics" rubric = "rubrics" collection = "collections" + # posts: `author: name` in the front matter; all posts of an author at /author/name/ + author = "author" [menus] [[menus.main]] diff --git a/layouts/_partials/post-summary.html b/layouts/_partials/post-summary.html index c4849f94..9b912a7e 100644 --- a/layouts/_partials/post-summary.html +++ b/layouts/_partials/post-summary.html @@ -4,7 +4,7 @@ {{ end }}

{{ .Title }}

-

{{ if not .Date.IsZero }}{{ end }}{{ with .Params.author }}{{ if not $.Date.IsZero }} · {{ end }}{{ . }}{{ end }}

+

{{ if not .Date.IsZero }}{{ end }}{{ with .GetTerms "author" }}{{ if not $.Date.IsZero }} · {{ end }}{{ partial "terms.html" (dict "page" $ "taxonomy" "author") }}{{ end }}

{{ .Summary }}
{{ if .Truncated }}

Read more →

{{ end }}
diff --git a/layouts/_partials/taxonomy-label.html b/layouts/_partials/taxonomy-label.html index 5a2de87a..b0639394 100644 --- a/layouts/_partials/taxonomy-label.html +++ b/layouts/_partials/taxonomy-label.html @@ -1,2 +1,2 @@ -{{- $labels := dict "category" "category" "type" "type" "origin" "country" "year" "year" "cpu" "CPU" "tag" "software tag" "topic" "topic" "rubric" "rubric" "collection" "collection" -}} +{{- $labels := dict "category" "category" "type" "type" "origin" "country" "year" "year" "cpu" "CPU" "tag" "software tag" "topic" "topic" "rubric" "rubric" "collection" "collection" "author" "author" -}} {{- index $labels . | default . -}} diff --git a/layouts/author/taxonomy.html b/layouts/author/taxonomy.html new file mode 100644 index 00000000..8100d60f --- /dev/null +++ b/layouts/author/taxonomy.html @@ -0,0 +1,10 @@ +{{ define "title" }}Authors · {{ site.Title }}{{ end }} +{{ define "main" }} +

{{ with site.GetPage "/post" }}{{ .Title }}{{ end }}

+

Authors

+ +{{ end }} diff --git a/layouts/author/term.html b/layouts/author/term.html new file mode 100644 index 00000000..593c27d0 --- /dev/null +++ b/layouts/author/term.html @@ -0,0 +1,8 @@ +{{ define "title" }}Posts by {{ .Title }} · {{ site.Title }}{{ end }} +{{ define "main" }} +

{{ with site.GetPage "/post" }}{{ .Title }}{{ end }} › Authors

+

Posts by {{ .Title }}

+
+ {{ range .Pages.ByDate.Reverse }}{{ partial "post-summary.html" . }}{{ end }} +
+{{ end }} diff --git a/layouts/post/single.html b/layouts/post/single.html index bcef5c46..d3c1678d 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -2,7 +2,7 @@

{{ .Parent.Title }}

{{ .Title }}

-

{{ if not .Date.IsZero }}{{ end }}{{ with .Params.author }}{{ if not $.Date.IsZero }} · {{ end }}{{ . }}{{ end }}

+

{{ if not .Date.IsZero }}{{ end }}{{ with .GetTerms "author" }}{{ if not $.Date.IsZero }} · {{ end }}{{ partial "terms.html" (dict "page" $ "taxonomy" "author") }}{{ end }}

{{ with partial "banner.html" (dict "page" . "width" 1000) }}{{ end }}
{{ .Content }}