From 314c26cac495435657228e5d12808f493f6ed402 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 11:41:47 +0100 Subject: [PATCH 1/9] Feat: Enable giscus comments This adds the necessary configuration to allow visitors to comment on venues. --- config.toml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 247407777ba..19d3a858cf6 100644 --- a/config.toml +++ b/config.toml @@ -33,7 +33,22 @@ relativeURLs = true service = 'GitHub' urlPatternEdit = 'https://github.com/%s/%s/edit/%s/%s' urlPatternView = 'https://github.com/%s/%s/blob/%s/%s' - + +[params.giscus] + repo = "nerdydaytrips/website" + repoID = "R_kgDOOu4FrA" + category = "Venues" + categoryID = "DIC_kwDOOu4FrM4Crptl" + mapping = "url" + strict = "0" + reactionsEnabled = "1" + emitMetadata = "0" + inputPosition = "top" + theme = "transparent_dark" + lang = "en" + loading = "lazy" + crossorigin = "anonymous" + [frontmatter] lastmod = ["lastmod", ":git", "date", "publishDate"] From 0004e4e0232d39fa1405bf643b63ec6cd1e57110 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 11:46:01 +0100 Subject: [PATCH 2/9] Add snippet to show giscus Snippet that will be used at the footer of pages to display comments, and the UI to add comments. --- themes/ndt2/layouts/partials/giscus.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 themes/ndt2/layouts/partials/giscus.html diff --git a/themes/ndt2/layouts/partials/giscus.html b/themes/ndt2/layouts/partials/giscus.html new file mode 100644 index 00000000000..cd95ed9fb7c --- /dev/null +++ b/themes/ndt2/layouts/partials/giscus.html @@ -0,0 +1,20 @@ +{{- if isset .Site.Params "giscus" -}} + {{- if and (isset .Site.Params.giscus "repo") (not (eq .Site.Params.giscus.repo "" )) (eq (.Params.disable_comments | default false) false) -}} + + + {{- end -}} +{{- end -}} From 24129571242095a6b4e1abf64c75d6ef44478700 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 11:48:29 +0100 Subject: [PATCH 3/9] Update footer.html to include giscus snippet In theory this should add the giscus snippet to the bottom of pages. --- themes/ndt2/layouts/partials/footer.html | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/ndt2/layouts/partials/footer.html b/themes/ndt2/layouts/partials/footer.html index 73420ef3dd1..d818cb2dc9d 100644 --- a/themes/ndt2/layouts/partials/footer.html +++ b/themes/ndt2/layouts/partials/footer.html @@ -1,3 +1,4 @@
+ {{ partial "giscus.html" . }} {{ .Site.Params.copyright }}
From 728ec47173d7d6d82c9b40d78e57bb109b105628 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 11:54:22 +0100 Subject: [PATCH 4/9] Update config.toml Switch to using pathname rather than URL for discussion topic --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 19d3a858cf6..72783b81e72 100644 --- a/config.toml +++ b/config.toml @@ -39,7 +39,7 @@ relativeURLs = true repoID = "R_kgDOOu4FrA" category = "Venues" categoryID = "DIC_kwDOOu4FrM4Crptl" - mapping = "url" + mapping = "pathname" strict = "0" reactionsEnabled = "1" emitMetadata = "0" From 489b0cd4517646a88fecb342fe43212bd9cd2f01 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 13:28:11 +0100 Subject: [PATCH 5/9] Turn off reactions and move comment box --- config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index 72783b81e72..9e62233c9ef 100644 --- a/config.toml +++ b/config.toml @@ -41,9 +41,9 @@ relativeURLs = true categoryID = "DIC_kwDOOu4FrM4Crptl" mapping = "pathname" strict = "0" - reactionsEnabled = "1" + reactionsEnabled = "0" emitMetadata = "0" - inputPosition = "top" + inputPosition = "bottom" theme = "transparent_dark" lang = "en" loading = "lazy" From b5d7dd7ce77f69b29628efcbcf54c99aa1cecdd4 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 13:39:43 +0100 Subject: [PATCH 6/9] Shrink bottom links text and fit on one line --- themes/ndt2/layouts/partials/repository-link.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/themes/ndt2/layouts/partials/repository-link.html b/themes/ndt2/layouts/partials/repository-link.html index e9259825ede..9a9b23c3615 100644 --- a/themes/ndt2/layouts/partials/repository-link.html +++ b/themes/ndt2/layouts/partials/repository-link.html @@ -6,15 +6,13 @@ {{- $icon := "" }} {{- if eq $.action "edit" }} {{- $href = printf .urlPatternEdit .owner .repo .branch $path | urls.JoinPath }} - {{- $text = printf "Edit this page on %s" .service }} + {{- $text = printf "Edit on %s" .service }} {{- $icon = "fa-solid fa-pen-to-square" }} {{- else if eq $.action "view" }} {{- $href = printf .urlPatternView .owner .repo .branch $path | urls.JoinPath }} - {{- $text = printf "View this page on %s" .service }} + {{- $text = printf "View on %s" .service }} {{- $icon = "fa-solid fa-eye" }} {{- end }} - +  {{ $text }} {{- end }} {{- end -}} \ No newline at end of file From 53a356dfdd7f442763713ed5633fcf386a04730b Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 13:40:10 +0100 Subject: [PATCH 7/9] Move giscus out of the footer, into the body --- themes/ndt2/layouts/partials/footer.html | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/ndt2/layouts/partials/footer.html b/themes/ndt2/layouts/partials/footer.html index d818cb2dc9d..73420ef3dd1 100644 --- a/themes/ndt2/layouts/partials/footer.html +++ b/themes/ndt2/layouts/partials/footer.html @@ -1,4 +1,3 @@
- {{ partial "giscus.html" . }} {{ .Site.Params.copyright }}
From 8e2ee2a29d209926542626576e555156404a86e7 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 13:40:33 +0100 Subject: [PATCH 8/9] Add giscus to blogs --- themes/ndt2/layouts/blog/single.html | 31 ++++++---------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/themes/ndt2/layouts/blog/single.html b/themes/ndt2/layouts/blog/single.html index 792d79be9f3..7c093eb8f64 100644 --- a/themes/ndt2/layouts/blog/single.html +++ b/themes/ndt2/layouts/blog/single.html @@ -65,8 +65,10 @@

{{ i18n "seeAlso" }}

{{ end }} {{ end }} -
+
{{ partial "repository-link.html" (dict "action" "edit" "page" .) }} + {{ partial "repository-link.html" (dict "action" "view" "page" .) }} +

{{ if ne .Type "page" }} @@ -83,28 +85,7 @@

{{ i18n "seeAlso" }}

{{ end }} {{ end }} -{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }} - {{ if .Site.DisqusShortname }} - {{ if .Site.Params.delayDisqus }} -
- -
- -
- {{ else }} -
- {{ template "_internal/disqus.html" . }} -
- {{ end }} - {{ end }} - {{ if .Site.Params.staticman }} -
- {{ partial "staticman-comments.html" . }} -
- {{ end }} -{{ end }} +
+{{ partial "giscus.html" . }} +
{{ end }} \ No newline at end of file From 91f2aa59ea378056c5d8480457feaa39fd8004bd Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Wed, 18 Jun 2025 13:40:50 +0100 Subject: [PATCH 9/9] Tiny title cleanup --- themes/ndt2/layouts/_default/single.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/themes/ndt2/layouts/_default/single.html b/themes/ndt2/layouts/_default/single.html index f4420448fb7..d5abaf232a5 100644 --- a/themes/ndt2/layouts/_default/single.html +++ b/themes/ndt2/layouts/_default/single.html @@ -2,8 +2,7 @@

{{ if .Params.lat }} -   - {{ end }} {{ .Title }} +   {{ end }}{{ .Title }} {{ if .Params.external_url }}   @@ -85,12 +84,14 @@

{{ if .Params.lat }} {{- end }} {{- .Content -}}

-
+
{{ if .Params.lat }} - Open in Google Maps -
- Open in OpenStreetMap -{{ end }} -{{ partial "repository-link.html" (dict "action" "edit" "page" .) }} + Google Maps  + OpenStreetMap +{{ end }}  +{{ partial "repository-link.html" (dict "action" "edit" "page" .) }}  {{ partial "repository-link.html" (dict "action" "view" "page" .) }} +

+{{ partial "giscus.html" . }} +
{{ end }}