Comments at the bottom of machine pages instead of a tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
2026-10-11 22:07:30 +02:00
co-authored by Claude Opus 5.5
parent 696dfe5e77
commit 2edf77aaa7
22 changed files with 40 additions and 77 deletions
+1 -20
View File
@@ -33,26 +33,7 @@
{{ end }}
</div>
{{ else if and (eq $tab "comments") $p.forum_thread site.Params.forum.url }}
{{/* live comments: the machine's forum thread, shown in a frame sized to its content */}}
{{ $thread := printf "%s/embed/%d" (strings.TrimSuffix "/" site.Params.forum.url) (int $p.forum_thread) }}
<p class="note">The first comments were left by visitors of the original site. Log in to the forum to add yours. <a href="{{ replace $thread "/embed/" "/d/" }}">Open this discussion in the forum</a>.</p>
<iframe class="forum-thread" id="forum-thread" src="{{ $thread }}" title="Comments on {{ $m.Title }}" loading="lazy"></iframe>
{{ with resources.Get "js/iframeResizer.min.js" | fingerprint }}
<script src="{{ .RelPermalink }}"></script>
<script>iFrameResize({ checkOrigin: false, heightCalculationMethod: "lowestElement" }, "#forum-thread");</script>
{{ end }}
{{ else if eq $tab "comments" }}
<p class="note">Comments left by visitors of the original site. New comments are closed.</p>
<ol class="comments">
{{ range $p.comments }}
<li>
<p class="meta"><strong>{{ .author }}</strong>{{ with .date }} · {{ . }}{{ end }}</p>
<div>{{ .text | markdownify }}</div>
</li>
{{ end }}
</ol>
{{ end }}
{{ partial "comments.html" $m }}
</article>
{{ end }}