diff options
author | kshcherban <konstantin.shcherban@auto1.com> | 2018-05-28 13:07:44 +0300 |
---|---|---|
committer | kshcherban <konstantin.shcherban@auto1.com> | 2018-05-28 13:07:44 +0300 |
commit | 878271a7be8cc8df6c95143861df42ad2a751ff0 (patch) | |
tree | 7ee4d2c1b5ce5bc72e8e7e20d87b81eec298d8cc | |
parent | 3c6844707f9156e0f535bc9b534a2ea6022db6bb (diff) |
Switched disqus engine to internal template (https://gohugo.io/templates/internal/#configure-disqus)
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/comments.html | 17 | ||||
-rw-r--r-- | theme.toml | 4 |
4 files changed, 6 insertions, 19 deletions
@@ -25,6 +25,7 @@ canonifyurls = true title = "Pixyll" author = "admin" theme = "pixyll" +disqusShortname = "sitename" [indexes] category = "categories" @@ -34,7 +35,6 @@ theme = "pixyll" search_engine = true google_analytics_id = "XX-XXXXXXXX-X" twitter_username = "username" - disqus_shortname = "sitename" paginate = true ``` diff --git a/exampleSite/config.toml b/exampleSite/config.toml index f6a6b2c..32a6e98 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,6 +13,7 @@ themesDir = "../.." title = "Pixyll" enableEmoji = true DefaultContentLanguage = "en" +#disqusShortname = "" [Languages] [Languages.en] @@ -33,5 +34,4 @@ hrefTargetBlank = true search_engine = true #google_analytics_id = "" twitter_username = "username" - #disqus_shortname = "" paginate = 5 diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index e050343..b4e3c17 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,16 +1,3 @@ -{{ if isset .Site.Params "disqus_shortname" }} -<div id="disqus_thread"></div> -<script type="text/javascript"> - var disqus_config = function () { - this.page.url = "{{ .Site.Params.disqus_shortname }}"; - this.page.identifier = "{{ .RelPermalink }}"; - }; - - (function() { // DON'T EDIT BELOW THIS LINE - var d = document, s = d.createElement('script'); - s.src = "https://{{ .Site.Params.disqus_shortname }}.disqus.com/embed.js"; - s.setAttribute('data-timestamp', +new Date()); - (d.head || d.body).appendChild(s); - })(); -</script> +{{ if (.Site.DisqusShortname) }} +{{ template "_internal/disqus.html" . }} {{ end }} @@ -3,5 +3,5 @@ description = "A simple, beautiful theme for Hugo." author = "Dmitriy Slupytskyi" license = "MIT" source_repo = "https://github.com/azmelanar/hugo-theme-pixyll" -tags = ["blog", "personal"] -min_version = 0.14 +tags = ["blog", "personal", "search", "responsive", "minimal"] +min_version = 0.25 |