show author on articles (single page byline + journal listing)
- Single page: 'von {Author} · {Date}' byline directly under H1 in
mono, editorial-style. Falls back to site.Params.author.name.
- Journal listing: author appended to existing meta row.
- Bottom .time line cleaned: only renders if there's reading time
or a meaningful lastmod, to avoid an empty meta strip.
Per-page override via 'author' frontmatter field; until set,
everything is credited to the site default author.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,14 @@
|
||||
<article class="single">
|
||||
<header class="single-header">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ $author := .Params.author | default site.Params.author.name }}
|
||||
{{ if or $author .Date }}
|
||||
<p class="single-byline">
|
||||
{{ with $author }}<span class="byline-author">von {{ . }}</span>{{ end }}
|
||||
{{ if and $author .Date }} · {{ end }}
|
||||
{{ if .Date }}<time class="byline-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ with .Params.summary }}
|
||||
<p class="single-summary text-muted">{{ . }}</p>
|
||||
{{ end }}
|
||||
@@ -23,19 +31,15 @@
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<div class="time">
|
||||
{{ partial "date.html" .Date }}
|
||||
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
|
||||
{{ if and $showReadingTime .ReadingTime }}
|
||||
<span class="reading-time"> · {{ .ReadingTime }} min Lesezeit</span>
|
||||
{{ end }}
|
||||
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
|
||||
{{ if and $showLastMod .Lastmod }}
|
||||
{{ if ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02") }}
|
||||
<span class="lastmod"> · Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }}</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
|
||||
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
|
||||
{{ $hasLastmod := and $showLastMod .Lastmod (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}
|
||||
{{ if or (and $showReadingTime .ReadingTime) $hasLastmod }}
|
||||
<div class="time">
|
||||
{{ if and $showReadingTime .ReadingTime }}<span class="reading-time">{{ .ReadingTime }} min Lesezeit</span>{{ end }}
|
||||
{{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}<span class="lastmod">Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }}</span>{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user