diff options
| -rw-r--r-- | README.md | 10 | ||||
| -rw-r--r-- | layouts/_default/single.html | 1 | ||||
| -rw-r--r-- | layouts/partials/comments.html | 18 | 
3 files changed, 29 insertions, 0 deletions
| @@ -193,6 +193,16 @@ url = "/posts"  name = "resume"  url = "/resume" +# giscus conf, for more detail, see https://giscus.app/ +[params.giscus] +  enable = true +  repo = "" +  repoid = "" +  category = "" +  categoryid = "" +  mapping = "pathname" +  theme = "light" +  # Syntax highlight on code blocks, all styles:   # https://xyproto.github.io/splash/docs/all.html  # I suggest algol diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c0f41c5..420a8ba 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -43,6 +43,7 @@    <div class="single-content">      {{ .Content }} +    {{ partial "comments.html" . }}    </div>  </div> diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..979b59e --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,18 @@ +{{ if .Site.Params.giscus.enable }} +<script src="https://giscus.app/client.js" +        data-repo="{{ .Site.Params.giscus.repo }}" +        data-repo-id="{{ .Site.Params.giscus.repoid }}" +        data-category="{{ .Site.Params.utteranc.category }}" +        data-category-id="{{ .Site.Params.giscus.categoryid }}" +        data-mapping="{{ .Site.Params.giscus.mapping }}" +        data-strict="0" +        data-reactions-enabled="1" +        data-emit-metadata="0" +        data-input-position="top" +        data-theme="{{ .Site.Params.giscus.theme }}" +        data-lang="en" +        data-loading="lazy" +        crossorigin="anonymous" +        async> +</script> +{{ end }}
\ No newline at end of file | 
