浏览代码

Use repoID and categoryID in giscus template (#560)

* Use repoID and categoryID in giscus template

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Fix links

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Emruz Hossain 3 年之前
父节点
当前提交
3809d298ca
共有 2 个文件被更改,包括 27 次插入14 次删除
  1. 16 7
      README.md
  2. 11 7
      layouts/partials/giscus.html

+ 16 - 7
README.md

@@ -30,8 +30,15 @@ A [Hugo](https://gohugo.io/) theme for a personal portfolio with minimalist desi
 - Achievement Gallery
 - Achievement Gallery
 - Sidebar to Categorize the Posts
 - Sidebar to Categorize the Posts
 - Short Codes
 - Short Codes
-- Google Analytics Support
-- Disqus Comment Support
+- Analytics Support
+  - GoatCounter
+  - counter.dev
+  - Google Analytics
+- Comment Support
+  - [Disqus](https://disqus.com/)
+  - [Valine](https://valine.js.org/)
+  - [Uttarances](https://utteranc.es/)
+  - [Giscus](https://giscus.app/)
 
 
 For more details about the features please visit [here](https://toha-guides.netlify.app/posts/features/).
 For more details about the features please visit [here](https://toha-guides.netlify.app/posts/features/).
 
 
@@ -71,7 +78,7 @@ Here are few screenshots from the [example site](https://hugo-toha.github.io).
 
 
 ## Requirements
 ## Requirements
 
 
-- Hugo Version 0.68.0 or higher
+- Hugo Version 0.87.0 or higher
 
 
 ## Usage
 ## Usage
 
 
@@ -165,10 +172,12 @@ When you run your site for first time, it will start with the default parameters
 
 
 Here, are some handy shortcodes you can use with this theme.
 Here, are some handy shortcodes you can use with this theme.
 
 
-- [Alert](https://toha-guides.netlify.app/posts/short-codes/alert/)
-- [Image](https://toha-guides.netlify.app/posts/short-codes/img/)
-- [Split](https://toha-guides.netlify.app/posts/short-codes/split/)
-- [Vertical Space](https://toha-guides.netlify.app/posts/short-codes/vs/)
+- [Alert](https://toha-guides.netlify.app/posts/shortcodes/#alert)
+- [Image](https://toha-guides.netlify.app/posts/shortcodes/#image)
+- [Split](https://toha-guides.netlify.app/posts/shortcodes/#split)
+- [Vertical Space](https://toha-guides.netlify.app/posts/shortcodes/#vertical-space)
+- [Video](https://toha-guides.netlify.app/posts/shortcodes/#video)
+- [Mermaid](https://hugo-toha.github.io/posts/shortcodes/#mermaid)
 
 
 ## Project Roadmap
 ## Project Roadmap
 
 

+ 11 - 7
layouts/partials/giscus.html

@@ -1,15 +1,19 @@
-{{ $repo := site.Params.features.comment.giscus.repo }}
-{{ $category := site.Params.features.comment.giscus.category | default "General" }}
-{{ $theme := site.Params.features.comment.giscus.theme | default "light" }}
-{{ $map := site.Params.features.comment.giscus.map | default "url" }}
-{{ $reaction := site.Params.features.comment.giscus.reaction | default "1" }}
-{{ $metadata := site.Params.features.comment.giscus.metadata | default "0" }}
+{{ $repo          := site.Params.features.comment.giscus.repo }}
+{{ $repoID        := site.Params.features.comment.giscus.repoID }}
+{{ $category      := site.Params.features.comment.giscus.category | default "General" }}
+{{ $categoryID    := site.Params.features.comment.giscus.categoryID }}
+{{ $theme         := site.Params.features.comment.giscus.theme | default "light" }}
+{{ $map           := site.Params.features.comment.giscus.map | default "url" }}
+{{ $reaction      := site.Params.features.comment.giscus.reaction | default "1" }}
+{{ $metadata      := site.Params.features.comment.giscus.metadata | default "0" }}
 {{ $inputPosition := site.Params.features.comment.giscus.inputPosition | default "bottom" }}
 {{ $inputPosition := site.Params.features.comment.giscus.inputPosition | default "bottom" }}
-{{ $crossOrigin := site.Params.features.comment.giscus.crossOrigin | default "anonymous" }}
+{{ $crossOrigin   := site.Params.features.comment.giscus.crossOrigin | default "anonymous" }}
 
 
 <script src="https://giscus.app/client.js"
 <script src="https://giscus.app/client.js"
         data-repo="{{ $repo }}"
         data-repo="{{ $repo }}"
+        data-repo-id="{{ $repoID }}"
         data-category="{{ $category }}"
         data-category="{{ $category }}"
+        data-category-id="{{ $categoryID }}"
         data-mapping="{{ $map }}"
         data-mapping="{{ $map }}"
         data-reactions-enabled="{{ $reaction }}"
         data-reactions-enabled="{{ $reaction }}"
         data-emit-metadata="{{ $metadata }}"
         data-emit-metadata="{{ $metadata }}"