diff options
| author | Reorx <novoreorx@gmail.com> | 2022-05-31 22:41:10 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-05-31 22:41:10 +0800 |
| commit | 5c47607d23d31bda44f2f660df372a924daa2381 (patch) | |
| tree | 314fb7db71f0a7b57d342ace9efdb20035d93e12 /layouts/partials/disqus_script.html | |
| parent | 81f885a7b99ac845348ba750a9419f50632fa985 (diff) | |
support specifying comment system in both config and front matter
in config: site.Params.defaultCommentSystems
in front matter: pageCommentSystems
Diffstat (limited to 'layouts/partials/disqus_script.html')
| -rw-r--r-- | layouts/partials/disqus_script.html | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/layouts/partials/disqus_script.html b/layouts/partials/disqus_script.html deleted file mode 100644 index 4840d14..0000000 --- a/layouts/partials/disqus_script.html +++ /dev/null @@ -1,27 +0,0 @@ -<script type="text/javascript"> - var disqus_config = function () { - this.page.url = '{{ .Page.Permalink }}'; // Replace PAGE_URL with your page's canonical URL variable - this.page.identifier = '{{ .Page.Permalink | path.Base }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable - }; - - (function () { - let disqusEmbedLoaded = window.disqusEmbedLoaded; - if (disqusEmbedLoaded) { - // Use DISQUS.reset instead of reloading embed.js please. - // https://help.disqus.com/en/articles/1717163-using-disqus-on-ajax-sites - DISQUS.reset({ - reload: true, - config: disqus_config, - }); - } else { - var d = document, s = d.createElement('script'); - s.src = '//' + '{{ site.Params.commentSystem.disqus.shortname }}' + '.disqus.com/embed.js'; - s.setAttribute('data-timestamp', +new Date()); - // prevent the <script> from loading mutiple times by InstantClick - s.setAttribute('data-no-instant', '') - d.head.appendChild(s); - - window.disqusEmbedLoaded = true; - } - })(); -</script> |
