Skip to content

Commit 85d1948

Browse files
authored
Merge pull request #4 from nkdAgility/update-discussion-link
Add dynamic discussion forum URL to guide navigation and update guide…
2 parents cc73fa3 + 1e4a5e3 commit 85d1948

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

module/layouts/_partials/components/guide/render-guide.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
<aside class="col-md-3" style="top: 1rem; max-height: 100vh;" aria-label="Table of contents navigation">
66
<nav class="content-list bg-light p-3 rounded h-100 d-flex flex-column" aria-label="Guide navigation">
77
<div class="content-collaboration d-flex justify-content-between align-items-center mb-3 pb-2 border-bottom">
8-
<a href="{{ .Site.Params.githubUrl }}/discussions" class="text-decoration-none text-primary" target="_blank"> <i class="fa-solid fa-comments me-1"></i>{{ i18n "guide_join_discussion" }} </a>
8+
{{- $sectionPage := .Site.GetPage .Section }}
9+
{{- $discussionUrl := .Site.Params.githubUrl | default "" }}
10+
{{- if $sectionPage }}
11+
{{- if $sectionPage.Params.discussionForumUrl }}
12+
{{- $discussionUrl = $sectionPage.Params.discussionForumUrl }}
13+
{{- else }}
14+
{{- $discussionUrl = printf "%s/discussions" (.Site.Params.githubUrl | default "") }}
15+
{{- end }}
16+
{{- else }}
17+
{{- /* Fallback: use default GitHub discussions URL if section page not found */}}
18+
{{- $discussionUrl = printf "%s/discussions" (.Site.Params.githubUrl | default "") }}
19+
{{- warnf "Section page not found for section '%s', using default discussion URL" .Section }}
20+
{{- end }}
21+
<a href="{{ $discussionUrl }}" class="text-decoration-none text-primary" target="_blank">
22+
<i class="fa-solid fa-comments me-1"></i>{{ i18n "guide_join_discussion" }}
23+
</a>
924
{{ partial "components/share-dropdown.html" . }}
1025
</div>
1126

site/content/Guide1/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ guide_overview: |
1111
[Guide 1](/guide-1/latest) is a practical, community-curated reference for best practices in knowledge work.
1212
guide_logo: "guide-1-logo.png"
1313
weight: 1
14+
discussionForumUrl: "https://forum.example.com/c/guide-1"
1415
guide_license: |
1516
This work is licensed by Generic Publishing Corp and Anonymous Authors under a Creative Commons Attribution 4.0 International License.
1617
guide_comparison:

0 commit comments

Comments
 (0)