Forum integration: Flarum extension, local test stack, embedded comments

- forum/extension: oc:import command (archived comments -> one thread per
  machine) and embed styling
- forum/docker: local Flarum 2 test stack
- site: optional params.forum.url adds a Forum menu entry and shows the
  machine thread in the Comments 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 21:21:08 +02:00
co-authored by Claude Opus 5.5
parent 2b5c9df929
commit 32b735283e
17 changed files with 436 additions and 2 deletions
+1
View File
@@ -17,6 +17,7 @@
{{ range site.Menus.main }}
<a href="{{ .URL }}"{{ if or ($current.IsMenuCurrent .Menu .) ($current.HasMenuCurrent .Menu .) (eq $current.Section .Page.Section) }} class="active"{{ end }}>{{ .Name }}</a>
{{ end }}
{{ with site.Params.forum.url }}<a href="{{ . }}">Forum</a>{{ end }}
</nav>
<form class="search" role="search" action="{{ "search/" | relURL }}" method="get">
<input type="search" name="q" placeholder="Search…" aria-label="Search the site">
+10
View File
@@ -33,6 +33,16 @@
{{ 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">