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:
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user