Junyi-99 / hugo-theme-anubis2

Anubis2 is a simple but elegant theme for Hugo blog engine
https://hugo-theme-anubis2.netlify.app/
MIT License
32 stars 9 forks source link

How to configure giscus? #24

Closed feiyangbeyond closed 3 months ago

feiyangbeyond commented 3 months ago

How to configure giscus?

Or should I read hugo's documentation?

Junyi-99 commented 3 months ago

Hey, thanks for using anubis2, here is the example config for giscus:

[params]
  GiscusRepo = "Junyi-99/Junyi-99.github.io"
  GiscusRepoId = "MDEwOlJlcG9zaXRvcnkzNDI4ODI3NzY="
  GiscusCategory = "Announcements"
  GiscusCategoryId = "DIC_kwDOFG_52M4CZZZF"
  GiscusLazyLoad = false
  GiscusDataMapping = "url"

Each parameter is obtained from the <script> provided by Giscus.

image
feiyangbeyond commented 3 months ago

I have configured it according to yours. But now there is an error:

my-first-post/:322 Uncaught ReferenceError: defaultTheme is not defined
    at detectCurrentScheme (my-first-post/:322:9)
    at my-first-post/:328:27
image
feiyangbeyond commented 3 months ago

Hugo version is:

hugo v0.124.0-629f84e8edfb0b1b743c3942cd039da1d99812b0+extended darwin/amd64 BuildDate=2024-03-16T15:44:32Z VendorInfo=brew
feiyangbeyond commented 3 months ago

After reading source code, change the config file:

params:
  colorthemeswitcher: true

There seems to be no explanation in the example