Files
OPENBUREAU/layouts/_default/single.html
T
karim af2b8c5060 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>
2026-05-23 20:58:57 +02:00

46 lines
1.8 KiB
HTML

{{ define "main" }}
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
<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 }}
</header>
{{/* Table of Contents */}}
{{ $hasToC := .Params.toc | default true }}
{{ $headers := findRE "<h[2-6]" .Content }}
{{ if and $hasToC (ge (len $headers) 1) }}
<nav class="toc">
<strong>Inhalt</strong>
<div class="toc-content">{{ .TableOfContents }}</div>
</nav>
{{ end }}
<div class="single-content">
{{ .Content }}
</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 }}