Skip to content

Commit f6792da

Browse files
authored
Fix deprecated config params (GA, Disqus) (#355)
As of Hugo 0.120.0, `.Site.disqusShortname` and `.Site.googleAnalytics` are deprecated. Backward compatible change, new notation supported from Hugo v0.41. See gohugoio/hugo@4ddcf52
1 parent 4a730e9 commit f6792da

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ title = "Mainroad"
5656
languageCode = "en-us"
5757
paginate = "10" # Number of posts per page
5858
theme = "mainroad"
59-
disqusShortname = "" # Enable Disqus comments by entering your Disqus shortname
60-
googleAnalytics = "" # Enable Google Analytics by entering your tracking id
59+
disqusShortname = "" # DEPRECATED! Use .Services.Disqus.Shortname
60+
googleAnalytics = "" # DEPRECATED! Use .Services.googleAnalytics.ID
61+
62+
[services.disqus]
63+
shortname = "" # Enable Disqus by entering your Disqus shortname
64+
[services.googleAnalytics]
65+
ID = "" # Enable Google Analytics by entering your tracking ID
6166

6267
[Author] # Used in authorbox
6368
name = "John Doe"

‎layouts/partials/comments.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Site.DisqusShortname (index .Params "comments" | default "true") (not .Site.IsServer) }}
1+
{{ if and .Site.Config.Services.Disqus.Shortname (index .Params "comments" | default "true") (not .Site.IsServer) }}
22
<section class="comments">
33
{{ template "_internal/disqus.html" . }}
44
</section>

0 commit comments

Comments
 (0)