Comment

Gungnir
2021-03-26
2 min

INFO

This feature is disabled by default.

TIP

Code related to the disabled features will not be included in your site's bundle files.

Giscus is supported as the third party comment system, which is powered by GitHub Discussions.

Preparation

Configuration

theme: gungnirTheme({
  themePlugins: {
    giscus: {
      repo: "[repo]",  // required, string, format: user_name/repo_name
      repoId: "[repo id]",  // required, string, generate it on Giscus's website
      category: "[category name]",  // required, string
      categoryId: "[category id]",  // required, string, generate it on Giscus's website
      mapping: "[page <-> discussion mapping]",  // optional, string, default="title"
      reactionsEnabled: "[enable reactions or not?]",  // optional, boolean, default=true
      lang: "[language]",  // optional, string, default="auto" (follow the site's language, fall to "en" if your site's language is not supported by Giscus)
      lazyLoad: true,  // optional, boolean, default=false (if true, loading of Giscus will be deferred until the user scrolls near the comments container)
      crossorigin: "[crossorigin]",  // optional, string, default="anonymous"
      theme: "[theme for light mode]",  // optional, string, default="light"
      darkTheme: "[theme for dark mode]"  // optional, string, default="dark_dimmed"
    }
  }
})

theme and darkTheme option could be a custom theme (a URL to a CSS file).

Refer to the plugin-giscus for more information.