Posts: author pages, linked from the author name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -21,7 +21,8 @@ Content pages are Markdown with YAML front matter and can be corrected by hand,
|
|||||||
make post NAME=my-title
|
make post NAME=my-title
|
||||||
|
|
||||||
creates `content/post/<today>-my-title.md` (any `.md` file in `content/post/` is a post). The
|
creates `content/post/<today>-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/<name>/`, 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
|
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
|
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
|
banner, date, author and summary (`summary:` in the front matter, or the text before
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ locale = "en"
|
|||||||
disableKinds = ["rss", "sitemap"]
|
disableKinds = ["rss", "sitemap"]
|
||||||
# pages keep working when the site is served from a sub-directory
|
# pages keep working when the site is served from a sub-directory
|
||||||
relativeURLs = true
|
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/)
|
# a post named 2026-10-11-my-title.md gets its date from the file name (and the URL /post/my-title/)
|
||||||
[frontmatter]
|
[frontmatter]
|
||||||
@@ -23,6 +25,8 @@ relativeURLs = true
|
|||||||
topic = "topics"
|
topic = "topics"
|
||||||
rubric = "rubrics"
|
rubric = "rubrics"
|
||||||
collection = "collections"
|
collection = "collections"
|
||||||
|
# posts: `author: name` in the front matter; all posts of an author at /author/name/
|
||||||
|
author = "author"
|
||||||
|
|
||||||
[menus]
|
[menus]
|
||||||
[[menus.main]]
|
[[menus.main]]
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
<div>
|
<div>
|
||||||
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||||
<p class="meta">{{ if not .Date.IsZero }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 January 2006" }}</time>{{ end }}{{ with .Params.author }}{{ if not $.Date.IsZero }} · {{ end }}{{ . }}{{ end }}</p>
|
<p class="meta">{{ if not .Date.IsZero }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 January 2006" }}</time>{{ end }}{{ with .GetTerms "author" }}{{ if not $.Date.IsZero }} · {{ end }}{{ partial "terms.html" (dict "page" $ "taxonomy" "author") }}{{ end }}</p>
|
||||||
<div class="summary">{{ .Summary }}</div>
|
<div class="summary">{{ .Summary }}</div>
|
||||||
{{ if .Truncated }}<p><a href="{{ .RelPermalink }}">Read more →</a></p>{{ end }}
|
{{ if .Truncated }}<p><a href="{{ .RelPermalink }}">Read more →</a></p>{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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 . -}}
|
{{- index $labels . | default . -}}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{{ define "title" }}Authors · {{ site.Title }}{{ end }}
|
||||||
|
{{ define "main" }}
|
||||||
|
<p class="crumbs">{{ with site.GetPage "/post" }}<a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end }}</p>
|
||||||
|
<h1>Authors</h1>
|
||||||
|
<ul class="columns">
|
||||||
|
{{ range .Data.Terms.Alphabetical }}
|
||||||
|
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> <small>({{ .Count }})</small></li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{{ define "title" }}Posts by {{ .Title }} · {{ site.Title }}{{ end }}
|
||||||
|
{{ define "main" }}
|
||||||
|
<p class="crumbs">{{ with site.GetPage "/post" }}<a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end }} › <a href="{{ .Parent.RelPermalink }}">Authors</a></p>
|
||||||
|
<h1>Posts by {{ .Title }}</h1>
|
||||||
|
<div class="posts">
|
||||||
|
{{ range .Pages.ByDate.Reverse }}{{ partial "post-summary.html" . }}{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<article class="post">
|
<article class="post">
|
||||||
<p class="crumbs"><a href="{{ .Parent.RelPermalink }}">{{ .Parent.Title }}</a></p>
|
<p class="crumbs"><a href="{{ .Parent.RelPermalink }}">{{ .Parent.Title }}</a></p>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<p class="meta">{{ if not .Date.IsZero }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 January 2006" }}</time>{{ end }}{{ with .Params.author }}{{ if not $.Date.IsZero }} · {{ end }}{{ . }}{{ end }}</p>
|
<p class="meta">{{ if not .Date.IsZero }}<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 January 2006" }}</time>{{ end }}{{ with .GetTerms "author" }}{{ if not $.Date.IsZero }} · {{ end }}{{ partial "terms.html" (dict "page" $ "taxonomy" "author") }}{{ end }}</p>
|
||||||
{{ with partial "banner.html" (dict "page" . "width" 1000) }}<img class="post-banner" src="{{ . }}" alt="">{{ end }}
|
{{ with partial "banner.html" (dict "page" . "width" 1000) }}<img class="post-banner" src="{{ . }}" alt="">{{ end }}
|
||||||
<div class="content">{{ .Content }}</div>
|
<div class="content">{{ .Content }}</div>
|
||||||
<nav class="prev-next">
|
<nav class="prev-next">
|
||||||
|
|||||||
Reference in New Issue
Block a user