From af2b8c5060154558c5b2b5b2af23ad774821025c Mon Sep 17 00:00:00 2001 From: karim Date: Sat, 23 May 2026 20:58:57 +0200 Subject: [PATCH] show author on articles (single page byline + journal listing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- assets/css/custom.css | 17 ++++++++++++++++- layouts/_default/single.html | 30 +++++++++++++++++------------- layouts/index.html | 2 ++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/assets/css/custom.css b/assets/css/custom.css index 9b0a7ed..33281b7 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -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 { diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0b5402e..d21bd77 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,6 +4,14 @@

{{ .Title }}

+ {{ $author := .Params.author | default site.Params.author.name }} + {{ if or $author .Date }} + + {{ end }} {{ with .Params.summary }}

{{ . }}

{{ end }} @@ -23,19 +31,15 @@ {{ .Content }} -
- {{ partial "date.html" .Date }} - {{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }} - {{ if and $showReadingTime .ReadingTime }} - · {{ .ReadingTime }} min Lesezeit - {{ 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") }} - · Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }} - {{ end }} - {{ end }} -
+ {{ $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 }} +
+ {{ if and $showReadingTime .ReadingTime }}{{ .ReadingTime }} min Lesezeit{{ end }} + {{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}Zuletzt aktualisiert: {{ .Lastmod.Format "2006-01-02" }}{{ end }} +
+ {{ end }}
{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 72d725a..3a5559f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,12 +13,14 @@
    {{ range $journal }}
  1. + {{ $author := .Params.author | default site.Params.author.name }}
    {{ with .Parent }} {{ .Title }} {{ end }} + {{ with $author }}{{ . }}{{ end }}

    {{ .LinkTitle }}

    {{ with .Params.summary }}