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-section { color: var(--accent); font-weight: 500; }
.journal-date { font-variant-numeric: tabular-nums; } .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 { .journal-title {
font-family: var(--font-family-display); font-family: var(--font-family-display);
@@ -434,12 +436,25 @@ a:hover {
line-height: 1.15; line-height: 1.15;
margin: 0 0 var(--spacing-xs); 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 { .single-summary {
font-family: var(--font-family-serif); font-family: var(--font-family-serif);
font-style: italic; font-style: italic;
font-size: 1.02rem; font-size: 1.02rem;
line-height: 1.45; line-height: 1.45;
margin: 0; margin: var(--spacing-xs) 0 0;
max-width: 55ch; max-width: 55ch;
} }
.single-content h2 { .single-content h2 {
+17 -13
View File
@@ -4,6 +4,14 @@
<article class="single"> <article class="single">
<header class="single-header"> <header class="single-header">
<h1>{{ .Title }}</h1> <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 }} {{ with .Params.summary }}
<p class="single-summary text-muted">{{ . }}</p> <p class="single-summary text-muted">{{ . }}</p>
{{ end }} {{ end }}
@@ -23,19 +31,15 @@
{{ .Content }} {{ .Content }}
</div> </div>
<div class="time"> {{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
{{ partial "date.html" .Date }} {{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }} {{ $hasLastmod := and $showLastMod .Lastmod (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}
{{ if and $showReadingTime .ReadingTime }} {{ if or (and $showReadingTime .ReadingTime) $hasLastmod }}
<span class="reading-time"> · {{ .ReadingTime }} min Lesezeit</span> <div class="time">
{{ end }} {{ if and $showReadingTime .ReadingTime }}<span class="reading-time">{{ .ReadingTime }} min Lesezeit</span>{{ end }}
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }} {{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}<span class="lastmod">Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }}</span>{{ end }}
{{ if and $showLastMod .Lastmod }} </div>
{{ if ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02") }} {{ end }}
<span class="lastmod"> · Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }}</span>
{{ end }}
{{ end }}
</div>
</article> </article>
{{ end }} {{ end }}
+2
View File
@@ -13,12 +13,14 @@
<ol class="journal-list"> <ol class="journal-list">
{{ range $journal }} {{ range $journal }}
<li class="journal-entry"> <li class="journal-entry">
{{ $author := .Params.author | default site.Params.author.name }}
<a class="journal-entry-link" href="{{ .RelPermalink }}"> <a class="journal-entry-link" href="{{ .RelPermalink }}">
<div class="journal-meta"> <div class="journal-meta">
{{ with .Parent }} {{ with .Parent }}
<span class="journal-section">{{ .Title }}</span> <span class="journal-section">{{ .Title }}</span>
{{ end }} {{ end }}
<time class="journal-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time> <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> </div>
<h3 class="journal-title">{{ .LinkTitle }}</h3> <h3 class="journal-title">{{ .LinkTitle }}</h3>
{{ with .Params.summary }} {{ with .Params.summary }}