diff options
author | Mike Bergeron <shortword@users.noreply.github.com> | 2018-07-09 15:01:18 +0300 |
---|---|---|
committer | Curtis Timson <curt@live.co.uk> | 2018-07-09 15:01:18 +0300 |
commit | d519eecd3226a9baf22480daafde3679136452e7 (patch) | |
tree | aa7a5f4e64263b3c60e7a407c15c85f899b60d50 | |
parent | a875df294885e590e6502bed008f797ba186cdb0 (diff) |
Use Hugo disqus template (#39)4.0.0
* Use Hugo disqus template
This commit makes the following changes:
* Remove the disqus partial present in the project
* Use the Hugo provided disqus template to lessen maintenance, and
provide a cohesive experience with the Hugo documentation
* Update config files to not use the previous local disqus partial
* Update the front-matter for the example posts
For more info about the disqus internal template please see this URL:
https://gohugo.io/templates/internal/#configure-disqus
Signed-off-by: Michael Bergeron <mikeb.code@gmail.com>
* Bump version due to disqus breaking change
-rw-r--r-- | exampleSite/config-prod.toml | 4 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | exampleSite/content/post/post.9.en.md | 2 | ||||
-rw-r--r-- | exampleSite/content/post/post.9.es.md | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 6 | ||||
-rw-r--r-- | layouts/partials/scripts/disqus.html | 19 | ||||
-rw-r--r-- | layouts/partials/scripts/index.html | 1 | ||||
-rw-r--r-- | package-lock.json | 2 | ||||
-rw-r--r-- | package.json | 2 |
9 files changed, 8 insertions, 34 deletions
diff --git a/exampleSite/config-prod.toml b/exampleSite/config-prod.toml index 1ddd58e..f774848 100644 --- a/exampleSite/config-prod.toml +++ b/exampleSite/config-prod.toml @@ -3,6 +3,7 @@ title = "Massively" baseURL = "https://hugo-theme-massively.netlify.com/" theme = "../.." googleanalytics = "UA-113904582-4" +disqusShortname = "hugo-massively" # [params] # set below parameter to define a favicon @@ -14,9 +15,6 @@ googleanalytics = "UA-113904582-4" # pagesize = "6" # featuredpost = "true" -[params.settings] - disqus = "hugo-massively" - [languages] [languages.en] languageName = "English" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 902552c..2ee3ef4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -3,6 +3,7 @@ title = "Massively" baseURL = "http://localhost:1313/" theme = "../.." googleanalytics = "UA-113904582-3" +disqusShortname = "hugo-massively" # [params] # set below parameter to define a favicon @@ -14,9 +15,6 @@ googleanalytics = "UA-113904582-3" # pagesize = "6" # featuredpost = "true" -[params.settings] - disqus = "hugo-massively" - [languages] [languages.en] languageName = "English" diff --git a/exampleSite/content/post/post.9.en.md b/exampleSite/content/post/post.9.en.md index 8397ee2..7f83ea7 100644 --- a/exampleSite/content/post/post.9.en.md +++ b/exampleSite/content/post/post.9.en.md @@ -4,5 +4,5 @@ slug = 'comments-example' image = 'images/pic04.jpg' date = "2018-02-20T00:00:00" description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' -disqusid = '9' +disqus_identifier = '9' +++
\ No newline at end of file diff --git a/exampleSite/content/post/post.9.es.md b/exampleSite/content/post/post.9.es.md index f3811b4..933c1cf 100644 --- a/exampleSite/content/post/post.9.es.md +++ b/exampleSite/content/post/post.9.es.md @@ -4,5 +4,5 @@ slug = 'comments-example' image = 'images/pic04.jpg' date = "2018-02-20T00:00:00" description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' -disqusid = '9' +disqus_identifier = '9' +++ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5860e0b..c52e501 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -25,10 +25,8 @@ {{ .Content }} {{ partial "postcustom" . }} - - {{ if .Params.disqusid }} - <div id="disqus_thread"></div> - {{ end }} + + {{ template "_internal/disqus.html" . }} </section> </div> diff --git a/layouts/partials/scripts/disqus.html b/layouts/partials/scripts/disqus.html deleted file mode 100644 index f698609..0000000 --- a/layouts/partials/scripts/disqus.html +++ /dev/null @@ -1,19 +0,0 @@ -{{ if and (.Site.Params.Settings.disqus) (.Params.disqusid) }} -<script> - /** - * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. - * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/ - - var disqus_config = function () { - this.page.url = {{ .Permalink }}; // Replace PAGE_URL with your page's canonical URL variable - this.page.identifier = {{ .Params.disqusid }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable - }; - - (function() { // DON'T EDIT BELOW THIS LINE - var d = document, s = d.createElement('script'); - s.src = 'https://{{ .Site.Params.Settings.disqus }}.disqus.com/embed.js'; - s.setAttribute('data-timestamp', +new Date()); - (d.head || d.body).appendChild(s); - })(); - </script> -{{ end }}
\ No newline at end of file diff --git a/layouts/partials/scripts/index.html b/layouts/partials/scripts/index.html index 2c4ef29..4bbdb51 100644 --- a/layouts/partials/scripts/index.html +++ b/layouts/partials/scripts/index.html @@ -6,4 +6,3 @@ <script src='{{ "assets/js/util.js" | relURL }}'></script> <script src='{{ "assets/js/main.js" | relURL }}'></script> -{{ partial "scripts/disqus" . }} diff --git a/package-lock.json b/package-lock.json index 983a30a..2e1f244 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "hugo-theme-massively", - "version": "2.2.2", + "version": "4.0.0", "lockfileVersion": 1 } diff --git a/package.json b/package.json index f4005a4..5e3355c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-theme-massively", - "version": "3.1.0", + "version": "4.0.0", "description": "HTML5 UP theme Massively for Hugo", "main": "index.js", "scripts": { |