diff options
author | amzrk2 | 2020-06-01 21:49:10 +0800 |
---|---|---|
committer | amzrk2 | 2020-06-01 21:49:10 +0800 |
commit | da23836b5dfe2d39cda0d89768dadd59b22a9baf (patch) | |
tree | a78f728fb3a335038a92fb14ad25df1678bec70a /layouts | |
parent | 02c3891865c7741b8f772aea75cc01564d2f0ff4 (diff) | |
download | hugo-theme-fuji-da23836b5dfe2d39cda0d89768dadd59b22a9baf.tar.gz hugo-theme-fuji-da23836b5dfe2d39cda0d89768dadd59b22a9baf.tar.bz2 hugo-theme-fuji-da23836b5dfe2d39cda0d89768dadd59b22a9baf.zip |
DisqusJS support added
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/comment-disqus.html | 6 | ||||
-rw-r--r-- | layouts/partials/head.html | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html index 539f8c7..75b3f4c 100644 --- a/layouts/partials/comment-disqus.html +++ b/layouts/partials/comment-disqus.html @@ -3,13 +3,13 @@ <div id="disqus_thread"></div> <script> var disqus_config = function () { - this.page.url = "{{ $.Permalink }}"; - this.page.identifier = "{{ $.RelPermalink }}"; + this.page.url = {{ $.Permalink }}; + this.page.identifier = {{ $.File.ContentBaseName }}; }; (function () { var d = document, s = d.createElement('script'); - s.src = 'https://{{ . }}.disqus.com/embed.js'; + s.src = 'https://' + {{ . }} + '.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); diff --git a/layouts/partials/head.html b/layouts/partials/head.html index bf6e1bf..c8a047b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -38,6 +38,9 @@ {{ if .Params.playerURL }} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css" /> {{ end }} +{{ if .Site.Params.useDisqusJS }} +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/disqusjs@1.3/dist/disqusjs.css" /> +{{ end }} {{ partial "analytic-gtag.html" . }} {{ partial "analytic-cfga.html" . }}
\ No newline at end of file |