From cd5d170d018dafd1659a4f21e7be5bef985ca25a Mon Sep 17 00:00:00 2001 From: Drew Kennedy Date: Sun, 27 Jul 2025 01:01:19 +1000 Subject: [PATCH 1/3] Add Giscus comments integration and styling --- _config.yml | 13 +++++++++++++ _includes/giscus.html | 20 ++++++++++++++++++++ _layouts/post.html | 4 ++-- assets/css/custom.css | 24 ++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 _includes/giscus.html diff --git a/_config.yml b/_config.yml index 462b37e..ad9e9e4 100644 --- a/_config.yml +++ b/_config.yml @@ -27,6 +27,19 @@ plugins: mermaid: src: 'https://unpkg.com/mermaid@10.6.1/dist/mermaid.min.js' +# Giscus comments configuration +giscus: + repo: "devnomadic/devnomadic.github.io" + repo-id: "MDEwOlJlcG9zaXRvcnkyOTYyMjkxOTE=" # Get this from giscus.app + category: "General" + category-id: "DIC_kwDOEagZR84CtcBV" # Get this from giscus.app + mapping: "pathname" + reactions-enabled: "1" + emit-metadata: "0" + input-position: "bottom" + theme: "preferred_color_scheme" + lang: "en" + # Theme settings dash: date_format: "%b %-d, %Y" diff --git a/_includes/giscus.html b/_includes/giscus.html new file mode 100644 index 0000000..df619be --- /dev/null +++ b/_includes/giscus.html @@ -0,0 +1,20 @@ +{% if site.giscus and site.giscus.repo %} +
+ +
+{% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index 8dd118f..aa89f89 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -28,9 +28,9 @@

{{ page.title }}

{{ content }} -{% if site.dash.disqus.shortname %} +{% if site.giscus and site.giscus.repo %}
-{% include disqus.html %} +{% include giscus.html %}
{% endif %} diff --git a/assets/css/custom.css b/assets/css/custom.css index add37db..4859cef 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -192,3 +192,27 @@ margin-bottom: 0.5em; } } + +/* Giscus comments styling */ +.comments { + margin-top: 3rem; + padding-top: 2rem; + border-top: 1px solid #e8eaed; +} + +.giscus-comments { + margin: 1rem 0; +} + +/* Ensure Giscus adapts to theme */ +.giscus-frame { + width: 100% !important; + border: none; +} + +/* Dark mode support for Giscus if needed */ +@media (prefers-color-scheme: dark) { + .comments { + border-top-color: #3c4043; + } +} From 2c9c6748373791ad70fdbf21ddbb8b2a47129c6c Mon Sep 17 00:00:00 2001 From: Drew Kennedy Date: Sun, 27 Jul 2025 01:42:21 +1000 Subject: [PATCH 2/3] Update Giscus theme setting and improve dark mode support comments --- _includes/giscus.html | 2 +- assets/css/custom.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/giscus.html b/_includes/giscus.html index df619be..7cdd6c1 100644 --- a/_includes/giscus.html +++ b/_includes/giscus.html @@ -11,7 +11,7 @@ data-reactions-enabled="{{ site.giscus.reactions-enabled }}" data-emit-metadata="{{ site.giscus.emit-metadata }}" data-input-position="{{ site.giscus.input-position }}" - data-theme="{{ site.giscus.theme }}" + data-theme="preferred_color_scheme" data-lang="{{ site.giscus.lang }}" crossorigin="anonymous" async> diff --git a/assets/css/custom.css b/assets/css/custom.css index 4859cef..5114cd1 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -210,7 +210,7 @@ border: none; } -/* Dark mode support for Giscus if needed */ +/* Dark mode support for Giscus */ @media (prefers-color-scheme: dark) { .comments { border-top-color: #3c4043; From 6688734977a7dec7749a6bd87fd65e152c4b2889 Mon Sep 17 00:00:00 2001 From: Drew Kennedy Date: Sun, 27 Jul 2025 01:48:49 +1000 Subject: [PATCH 3/3] Implement theme toggle functionality and update Giscus theme handling --- _includes/giscus.html | 51 +++++++++++++++++++++++++++++++- _includes/header.html | 67 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/_includes/giscus.html b/_includes/giscus.html index 7cdd6c1..d6ee1ca 100644 --- a/_includes/giscus.html +++ b/_includes/giscus.html @@ -11,10 +11,59 @@ data-reactions-enabled="{{ site.giscus.reactions-enabled }}" data-emit-metadata="{{ site.giscus.emit-metadata }}" data-input-position="{{ site.giscus.input-position }}" - data-theme="preferred_color_scheme" + data-theme="dark" data-lang="{{ site.giscus.lang }}" crossorigin="anonymous" async> + + {% endif %} diff --git a/_includes/header.html b/_includes/header.html index f1823ac..dbd010c 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -10,6 +10,25 @@ {% endif %} {% endfor %} + + +
+ + +
+
About @@ -18,3 +37,51 @@
+ +