In my opinion this tool is very useful for development websites or smaller developer blogs (like this one) because the discussion can be continued over at Github or on the website, whatever you or your visitors prefer. And… aren’t comments discussions? They finally arrived where they belong (at least in Github based websites and projects).
You can see Giscus in action at the end of this post or any other post on this website. Feel free to test, but please try to add a useful comment 😉
I created a GoHugo module in davidsneighbour/hugo-giscus that you can use easily to add Giscus to your website. The plan is to add the script as unobstrusive as possible to your website and add belated loading and easy design options to it. Just follow these steps to add it to your GoHugo website:
Go to giscus.app/ and fill out the form in the “Configuration” section. Copy the resulting code and paste into your scratch pad.
Add the component to your config.toml (or at the appropriate location in your configuration):
Add your Giscus configuration to config.toml:
Update your modules
Add the giscus-partial to your single.html or any post layout you are using in your theme:
- src: (default
https://giscus.app/client.js) - useful if you host your own version of Giscus
- dataRepo: (required, your-github-username/reponame)
- dataRepoId: (required)
- dataCategory: (required) it’s recommended to create a category “Comments” before you start configuration, so all your comments are in the same dedicated category.
- dataCategoryId: (required)
- dataMapping: (default “title”) set up if
- dataReactionsEnabled: (default “0”)
- dataEmitMetadata: (default “0”)
- dataTheme: (default “light”)
- dataLang: (default “en”) currently available are en, fr, id, pl, ro
- loading the JS without impacting page performance
- add SASS files for theme creation via configuration
- if you have any ideas feel free to open an issue.