diff options
author | amzrk2 | 2020-04-15 13:29:44 +0800 |
---|---|---|
committer | amzrk2 | 2020-04-15 13:29:44 +0800 |
commit | a8f47568568dee333081a2d204fad41fd81cda93 (patch) | |
tree | 48aa6ae0720ee21a8cbc42d7f3d83fec206c40e9 | |
parent | 10b5414837fc272b73922e01d2fe24ddd5080293 (diff) | |
download | hugo-theme-fuji-a8f47568568dee333081a2d204fad41fd81cda93.tar.gz hugo-theme-fuji-a8f47568568dee333081a2d204fad41fd81cda93.tar.bz2 hugo-theme-fuji-a8f47568568dee333081a2d204fad41fd81cda93.zip |
Disqus support
-rw-r--r-- | assets/sass/_list.scss | 6 | ||||
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/_default/single.html | 3 | ||||
-rw-r--r-- | layouts/partials/comment-disqus.html | 16 |
4 files changed, 27 insertions, 1 deletions
diff --git a/assets/sass/_list.scss b/assets/sass/_list.scss index 57f9fe9..1394f76 100644 --- a/assets/sass/_list.scss +++ b/assets/sass/_list.scss @@ -2,7 +2,7 @@ padding: 0 1em 0 1em; // different padding when screen size below width-md(768px) - @media screen and (max-width: $width-md){ + @media screen and (max-width: $width-md) { padding: 0 1.5em 0 1.5em; } } @@ -64,4 +64,8 @@ article { // not show while iframe not loaded #post-comment .utterances-frame { border-top: $spliter; +} + +#post-comment #disqus_thread { + border-top: $spliter; }
\ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 62fceb9..b6d882f 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -35,6 +35,9 @@ paginate = 10 # utterancesIssueTerm = "pathname" # utterancesTheme = "github-light" + # Disqus, see: https://disqus.com/admin/install/platforms/universalcode/ + # disqusShortname = "[ENTER YOUR DISQUS SHORTNAME HERE]" + # Custom lazyload thumbnail cdnLazyloadSRC = "https://cdn.jsdelivr.net/gh/amzrk2/poal-jsdelivr/lazyload/dsr_loading.svg" # Custom css & js CDN diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6bfce19..78a9148 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -24,6 +24,9 @@ {{ if .Site.Params.cdnUtterancesJS }} {{ partial "comment-utterances.html" . }} {{ end }} + {{ if .Site.Params.disqusShortname }} + {{ partial "comment-disqus.html" . }} + {{ end }} </div> <!-- sidebar --> <div class="col-md-3 col-12 float-left" id="sidebar"> diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html new file mode 100644 index 0000000..4477226 --- /dev/null +++ b/layouts/partials/comment-disqus.html @@ -0,0 +1,16 @@ +<div id="post-comment"> + <div id="disqus_thread"></div> + <script> + var disqus_config = function () { + this.page.url = "{{ .Permalink }}"; + this.page.identifier = "{{ .RelPermalink }}"; + }; + (function () { + var d = document, + s = d.createElement('script'); + s.src = 'https://{{ .Site.Params.disqusShortname }}.disqus.com/embed.js'; + s.setAttribute('data-timestamp', +new Date()); + (d.head || d.body).appendChild(s); + })(); + </script> +</div>
\ No newline at end of file |