feature: lebende Dokumente — Fußnoten/Quellen + Provenance/Zitieren
- Fußnoten (Goldmark [^1], schon nativ) gestylt: ruhiges Schriftbild, automatische „Quellen"-Überschrift statt <hr> - provenance.html-Partial bei Library-Beiträgen: Version → Commit, Verlauf (Gitea), „Zitieren"-Knopf (kopiert Quellenangabe in die Zwischenablage) - repoURL-Param (git.openbureau.ch) für die Provenance-Links Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{{/* Herkunft eines Beitrags: Version (→ Commit), Verlauf, Zitieren.
|
||||
Version/Verlauf nur, wenn Git-Info da ist (enableGitInfo) und repoURL gesetzt.
|
||||
„Zitieren" kopiert eine Quellenangabe in die Zwischenablage. */}}
|
||||
{{ $repo := site.Params.repoURL }}
|
||||
{{ $author := .Params.author | default site.Params.author.name }}
|
||||
<div class="provenance" aria-label="Herkunft">
|
||||
{{ with .GitInfo }}
|
||||
{{ with $repo }}
|
||||
<a class="prov-version" href="{{ . }}/commit/{{ $.GitInfo.Hash }}" title="Diese Version als Commit ansehen">Version {{ $.GitInfo.AbbreviatedHash }}</a>
|
||||
<span class="prov-sep">·</span>
|
||||
<a class="prov-history" href="{{ . }}/commits/branch/main/content/{{ $.File.Path }}">Verlauf</a>
|
||||
<span class="prov-sep">·</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<button type="button" class="prov-cite"
|
||||
data-title="{{ .Title }}"
|
||||
data-author="{{ $author }}"
|
||||
data-url="{{ .Permalink }}"
|
||||
{{ with .GitInfo }}data-version="{{ .AbbreviatedHash }}"{{ end }}>Zitieren</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
if (window.__provCite) return; window.__provCite = 1;
|
||||
document.querySelectorAll('.prov-cite').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var d = btn.dataset;
|
||||
var today = new Date().toLocaleDateString('de-CH');
|
||||
var v = d.version ? ', Version ' + d.version : '';
|
||||
var cite = d.author + ': ' + d.title + '. OPENBUREAU' + v + '. Abgerufen am ' + today + ', ' + d.url;
|
||||
navigator.clipboard.writeText(cite).then(function () {
|
||||
var t = btn.textContent; btn.textContent = 'Kopiert ✓';
|
||||
setTimeout(function () { btn.textContent = t; }, 1500);
|
||||
}).catch(function () {});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
Reference in New Issue
Block a user