-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add giscus comments system (#96)
* chore: rename comment to comments * docs: add giscus comments * docs: update
- Loading branch information
Showing
11 changed files
with
68 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Comments System | ||
linkTitle: Comments | ||
--- | ||
|
||
Hextra supports adding comments system to your site. | ||
Currently [giscus](https://giscus.app/) is supported. | ||
|
||
<!--more--> | ||
|
||
## giscus | ||
|
||
[giscus](https://giscus.app/) is a comments system powered by [GitHub Discussions](https://docs.github.com/en/discussions). It is free and open source. | ||
|
||
To enable giscus, you need to add the following to the site configuration file: | ||
|
||
```yaml {filename="hugo.yaml"} | ||
params: | ||
comments: | ||
enable: false | ||
type: giscus | ||
|
||
giscus: | ||
repo: <repository> | ||
repoId: <repository ID> | ||
category: <category> | ||
categoryId: <category ID> | ||
``` | ||
The giscus configurations can be constructed from the [giscus.app](https://giscus.app/) website. More details can also be found there. | ||
Comments can be enabled or disabled for a specific page in the page front matter: | ||
```yaml {filename="content/docs/about.md"} | ||
--- | ||
title: About | ||
comments: true | ||
--- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- $enableComments := site.Params.comments.enable | default false -}} | ||
|
||
{{ if not (eq .Params.comments nil) }} | ||
{{ $enableComments = .Params.comments }} | ||
{{ end }} | ||
|
||
{{- if $enableComments -}} | ||
{{- if eq site.Params.comments.type "giscus" -}} | ||
{{ partial "components/giscus.html" . }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters