22c9b9ff61
- Version/Verlauf/Zitieren als dezente Outline-Pills (wie Versions-Marke), „·"-Trenner entfernt - Byline (Autor) + „Aktualisiert am" nur noch bei Library-Beiträgen; Seiten wie Manifest/Kontakt/Spenden/Colophon zeigen sie nicht mehr Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
101 lines
4.6 KiB
HTML
101 lines
4.6 KiB
HTML
{{ define "main" }}
|
|
{{ $section := "" }}
|
|
{{ with .Parent }}{{ $section = path.Base .RelPermalink }}{{ end }}
|
|
{{ $cover := .Params.cover_image }}
|
|
{{ $color := .Params.color }}
|
|
|
|
{{/* Cover image first (full-bleed, directly under the masthead) */}}
|
|
{{ if $cover }}
|
|
<img class="single-hero-image" src="{{ $cover | relURL }}" alt="" loading="eager" />
|
|
{{ end }}
|
|
|
|
<article class="single" data-section="{{ $section }}"{{ with $color }} data-color="{{ . }}"{{ end }}>
|
|
<header class="single-header">
|
|
<h1>{{ .Title }}</h1>
|
|
{{ with .Params.summary }}
|
|
<p class="single-summary">{{ . }}</p>
|
|
{{ end }}
|
|
{{/* Byline + Meta nur bei Library-Beiträgen — Seiten wie Manifest,
|
|
Kontakt, Spenden brauchen weder Autor noch „Aktualisiert am". */}}
|
|
{{ if eq .Section "library" }}
|
|
{{ $author := .Params.author | default site.Params.author.name }}
|
|
{{ $aslug := urlize $author }}
|
|
{{ if not .Params.author }}{{ with index site.Data.authors site.Params.author.email }}{{ with .slug }}{{ $aslug = . }}{{ end }}{{ end }}{{ end }}
|
|
{{ $authorPage := and (ne $aslug "") (site.GetPage (printf "/authors/%s" $aslug)) }}
|
|
{{ if or $author .Date }}
|
|
<p class="single-byline">
|
|
{{- with $author -}}
|
|
{{- if $authorPage -}}<a class="byline-author" href="{{ $authorPage.RelPermalink }}">{{ . }}</a>
|
|
{{- else -}}<span class="byline-author">{{ . }}</span>{{- end -}}
|
|
{{- end -}}
|
|
{{- if and $author .Date -}}, {{ end -}}
|
|
{{- if .Date -}}<time class="byline-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>{{- end -}}
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{/* Reading time + last-modified — Republik-style, directly below byline */}}
|
|
{{ $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 }}
|
|
<p class="single-meta">
|
|
{{ if and $showReadingTime .ReadingTime }}<span class="reading-time">{{ .ReadingTime }} min Lesezeit</span>{{ end }}
|
|
{{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}<span class="lastmod">Aktualisiert am {{ .Lastmod.Format "02.01.2006" }}</span>{{ end }}
|
|
</p>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{/* Versions-Marke: macht bewusst, dass dies eine bestimmte Fassung ist,
|
|
und öffnet den Verlauf (alte Fassungen direkt auf der Seite). */}}
|
|
{{ if and (eq .Section "library") .GitInfo }}
|
|
<p class="version-line">
|
|
<button type="button" id="version-badge" class="version-badge" aria-expanded="false"
|
|
data-path="{{ .File.Path }}">Version {{ .GitInfo.AbbreviatedHash }}</button>
|
|
</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>
|
|
|
|
{{/* Tags as small pills at the bottom — Republik-style, no hash symbol */}}
|
|
{{- with .Params.tags }}
|
|
<ul class="tag-pills" aria-label="Tags">
|
|
{{- range . -}}<li><a href="/tags/{{ . | urlize }}/">{{ . }}</a></li>{{- end -}}
|
|
</ul>
|
|
{{- end }}
|
|
|
|
{{/* Herkunft/Zitieren — nur bei Library-Beiträgen (lebendes Dokument). */}}
|
|
{{ if eq .Section "library" }}
|
|
{{ partial "provenance.html" . }}
|
|
<script src="/version-history.js"></script>
|
|
{{ end }}
|
|
|
|
{{/* Dialog nur bei Artikeln (Library), nicht auf Seiten wie Spenden/Manifest. */}}
|
|
{{ if eq .Section "library" }}
|
|
<a class="dialog-link" id="dialog-link" data-thread="{{ .RelPermalink }}" href="/dialog/?thread={{ .RelPermalink }}">→ Dialog</a>
|
|
<script>
|
|
(function () {
|
|
var l = document.getElementById('dialog-link'); if (!l) return;
|
|
fetch('/api/comments?thread=' + encodeURIComponent(l.dataset.thread))
|
|
.then(function (r) { return r.ok ? r.json() : []; })
|
|
.then(function (d) { var n = d.filter(function (c) { return !c.deleted; }).length; if (n) l.textContent = '→ Dialog · ' + n; })
|
|
.catch(function () {});
|
|
})();
|
|
</script>
|
|
{{ end }}
|
|
</article>
|
|
|
|
{{ end }}
|