diff options
author | Shunya Ueta <shunyaueta01@gmail.com> | 2020-08-10 18:21:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-10 18:21:09 +0300 |
commit | 3a2ebe49885f6c0aeab06c9493c5323b735bc079 (patch) | |
tree | c0bef034f5ca37fbd7c9ccfa1584a06827ea51d3 | |
parent | f3070e19fd2542bbaeec82795d307a1a588eb515 (diff) |
enhance [feature]: utterances comment system
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | exampleSite/content/docs/comments-support.md | 14 | ||||
-rw-r--r-- | layouts/partials/comments/utterances.html | 11 |
3 files changed, 23 insertions, 6 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d5f67c2..7606b06 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -103,7 +103,9 @@ repository = "minimo" # Utterances: https://utteranc.es [params.comments.utterances] enable = false -issueTerm = "pathname" # pathname / url / title +issueTerm = "pathname" # pathname / url / title / og:title / <string> +label = "" +theme = "github-light" [params.comments.utterances.github] username = "MunifTanjim" diff --git a/exampleSite/content/docs/comments-support.md b/exampleSite/content/docs/comments-support.md index fb555d9..13336e5 100644 --- a/exampleSite/content/docs/comments-support.md +++ b/exampleSite/content/docs/comments-support.md @@ -1,8 +1,8 @@ --- date: 2018-03-29T09:00:00+06:00 -lastmod: 2019-07-12T23:00:00+06:00 +lastmod: 2020-08-10T22:00:00+06:00 title: Comments Support -authors: ["muniftanjim"] +authors: ['muniftanjim'] categories: - features tags: @@ -11,6 +11,7 @@ slug: comments-support comments: true toc: true --- + Minimo has support for comments baked into it. ## Enable/Disable Comments @@ -35,6 +36,7 @@ The global `.Site.Params.comments.enable` setting can be overridden for specific --- comments: true --- + ``` - `comments` [`Boolean`]: Enable/Disable comments for specific posts @@ -128,7 +130,9 @@ For using Utterances, set up the following options in your `config.toml` file: ```toml [params.comments.utterances] enable = true -issueTerm = "pathname" # pathname / url / title +issueTerm = "pathname" # pathname / url / title / og:title / <string> +label = "" +theme = "github-light" [params.comments.utterances.github] username = "MunifTanjim" @@ -137,7 +141,9 @@ repository = "minimo" - `params.comments.utterances` [`Map`]: - `enable` [`Boolean`]: Enable Utterances - - `issueTerm` [`String`]: Entry to Issue mapping option _(`pathname` / `url` / `title`)_ + - `issueTerm` [`String`]: Entry to Issue mapping option _(`pathname` / `url` / `title` / `og:title` / <string>)_ + - `label` [`String`]: Label will be assigned to issues created by Utterances + - `theme` [`String`]: Utterances theme that matches your blog - `params.comments.utterances.github` [`Map`]: - `username` [`String`]: Your GitHub Username - `repository` [`String`]: Name of your Site's GitHub Repository diff --git a/layouts/partials/comments/utterances.html b/layouts/partials/comments/utterances.html index 8a4fbb2..bed3196 100644 --- a/layouts/partials/comments/utterances.html +++ b/layouts/partials/comments/utterances.html @@ -1,10 +1,19 @@ {{- $scriptSrc := "https://utteranc.es/client.js" -}} {{- $issueTerm := .Page.Site.Params.comments.utterances.issueTerm -}} +{{- $label := .Page.Site.Params.comments.utterances.label -}} +{{- $theme := .Page.Site.Params.comments.utterances.theme -}} {{- $username := .Page.Site.Params.comments.utterances.github.username -}} {{- $repository := .Page.Site.Params.comments.utterances.github.repository -}} <script src='{{ $scriptSrc }}' - repo='{{ print $username "/" $repository }}' issue-term='{{ $issueTerm }}' + repo='{{ print $username "/" $repository }}' + issue-term='{{ $issueTerm }}' + {{ if $label -}} + label='{{ $label }}' + {{- end }} + {{ if $theme -}} + theme='{{ $theme }}' + {{- end }} crossorigin='anonymous' async> </script> |