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:
2026-05-23 20:58:57 +02:00
parent f586da8ba7
commit af2b8c5060
3 changed files with 35 additions and 14 deletions
+16 -1
View File
@@ -253,6 +253,8 @@ a:hover {
}
.journal-section { color: var(--accent); font-weight: 500; }
.journal-date { font-variant-numeric: tabular-nums; }
.journal-author { color: var(--color-text-primary); font-weight: 500; }
.journal-author::before { content: "von "; color: var(--color-text-muted); font-weight: 400; }
.journal-title {
font-family: var(--font-family-display);
@@ -434,12 +436,25 @@ a:hover {
line-height: 1.15;
margin: 0 0 var(--spacing-xs);
}
.single-byline {
font-family: var(--font-family-mono);
font-size: 0.85rem;
color: var(--color-text-muted);
margin: 0 0 var(--spacing-xs);
display: flex;
flex-wrap: wrap;
gap: 0.6rem;
align-items: baseline;
}
.byline-author { color: var(--color-text-primary); font-weight: 500; }
.byline-date { font-variant-numeric: tabular-nums; }
.single-summary {
font-family: var(--font-family-serif);
font-style: italic;
font-size: 1.02rem;
line-height: 1.45;
margin: 0;
margin: var(--spacing-xs) 0 0;
max-width: 55ch;
}
.single-content h2 {
+14 -10
View File
@@ -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 }}
{{ $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 }}
+2
View File
@@ -13,12 +13,14 @@
<ol class="journal-list">
{{ range $journal }}
<li class="journal-entry">
{{ $author := .Params.author | default site.Params.author.name }}
<a class="journal-entry-link" href="{{ .RelPermalink }}">
<div class="journal-meta">
{{ with .Parent }}
<span class="journal-section">{{ .Title }}</span>
{{ end }}
<time class="journal-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
{{ with $author }}<span class="journal-author">{{ . }}</span>{{ end }}
</div>
<h3 class="journal-title">{{ .LinkTitle }}</h3>
{{ with .Params.summary }}