diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 2d7b955f..6d7adb76 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -127,6 +127,7 @@ commento = false [utterances] # https://utteranc.es/ owner = "" # Your GitHub ID repo = "" # The repo to store comments + issueTerm = "" # Choose the mapping between blog posts and GitHub issues. pathname (default), title, url, og:title... [gitalk] # Gitalk is a comment system based on GitHub issues. see https://github.com/gitalk/gitalk owner = "" # Your GitHub ID diff --git a/layouts/partials/comments/utterances.html b/layouts/partials/comments/utterances.html index 16da7e75..abea153c 100644 --- a/layouts/partials/comments/utterances.html +++ b/layouts/partials/comments/utterances.html @@ -21,6 +21,8 @@ var owner = JSON.parse({{ $owner | jsonify }}); {{ $repo:= .Site.Params.utterances.repo }} var repo = JSON.parse({{ $repo | jsonify }}); + {{ $issueTerm:= .Site.Params.utterances.issueTerm | default "pathname" }} + var issueTerm = JSON.parse({{ $issueTerm | jsonify }}); {{ $baseTheme:= index .Site.Params.themeOptions 0 }} var baseTheme = JSON.parse({{ $baseTheme | jsonify }}); var localTheme = localStorage.getItem('theme'); @@ -28,7 +30,7 @@ var myScript = document.createElement('script'); myScript.setAttribute('src', 'https://utteranc.es/client.js'); myScript.setAttribute('repo', `${owner}/${repo}`); - myScript.setAttribute('issue-term', 'pathname'); + myScript.setAttribute('issue-term', issueTerm); myScript.setAttribute('theme', utterTheme); myScript.setAttribute('crossorigin', 'anonymous'); myScript.setAttribute('async', '');