dialog: auf eigene Seite auslagern — Beitrag bleibt sauber

- single.html: eingebetteter Dialog raus, stattdessen „→ Dialog"-Link
- neue /dialog/-Seite (content/dialog.md + layouts/_default/dialog.html) mit
  Thread aus ?thread=, Rücklink zum Beitrag
- dialog.js liest Thread aus data-thread ODER ?thread=
- Styling: Pill-Link am Beitragsende, zentrierte Dialog-Seite

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 14:14:21 +02:00
parent e787961059
commit 1ff2eb48f9
5 changed files with 49 additions and 10 deletions
+19
View File
@@ -0,0 +1,19 @@
{{ define "main" }}
<div class="dialog-page">
<p class="dialog-back" id="dialog-context"></p>
<section id="ob-dialog"></section>
</div>
<script defer src="/dialog.js"></script>
<script>
/* Kontext: Rücklink zum diskutierten Beitrag (thread = dessen Pfad). */
(function () {
var t = new URLSearchParams(location.search).get('thread');
var el = document.getElementById('dialog-context');
if (t && el) {
var a = document.createElement('a');
a.href = t; a.textContent = '← zum Beitrag';
el.appendChild(a);
}
})();
</script>
{{ end }}
+3 -4
View File
@@ -62,10 +62,9 @@
{{- range . -}}<li><a href="/tags/{{ . | urlize }}/">{{ . }}</a></li>{{- end -}}
</ul>
{{- end }}
{{/* Dialog liegt auf eigener Seite — der Beitrag bleibt sauber */}}
<a class="dialog-link" href="/dialog/?thread={{ .RelPermalink }}">→ Dialog</a>
</article>
{{/* Dialog — jeder Beitrag ist ein Diskussionsstart */}}
<section class="dialog" id="ob-dialog" data-thread="{{ .RelPermalink }}"></section>
<script defer src="/dialog.js"></script>
{{ end }}