Skip to content

Commit

Permalink
fix: Disqus deprecation warning, upgrade Hugo version (#166)
Browse files Browse the repository at this point in the history
* fix deprecation warnings regarding disqus
* upgrade Hugo version used in Netlify
* rename config.toml to hugo.toml
  • Loading branch information
deining authored Mar 4, 2024
1 parent 3493495 commit 9f9c93a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.hugo_build.lock
.hvm
exampleSite/public/
exampleSite/resources/
exampleSite/.hugo_build.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Then, edit the `my-first-post.md` file to suit your needs.

### Comments

To enable Disqus comments, set `disqusShortname` in your site's `config.toml`.
To enable Disqus comments, set `services.disqus.shortname` in your site's `hugo.toml`.

To use another comments system, provide your own `comments.html` partial in `layouts\partials\comments.html`.

Expand Down
15 changes: 9 additions & 6 deletions exampleSite/config.toml → exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ theme = "hugo-blog-awesome"
# This defines how dates are formatted
defaultContentLanguage = "en-gb"

# To enable Google Analytics 4 (gtag.js) provide G-MEASUREMENT_ID below.
# To disable Google Analytics, simply leave the field empty or remove the next line
googleAnalytics = '' # G-MEASUREMENT_ID

# Enable emojis globally
enableEmoji = true
ignoreErrors = ["additional-script-loading-error"] # ignore error of loading additional scripts.

[services]
# To enable Google Analytics 4 (gtag.js) provide G-MEASUREMENT_ID below.
# To disable Google Analytics, simply leave the field empty or remove the next two lines
[services.googleAnalytics]
id = '' # G-MEASUREMENT_ID

# To enable Disqus comments, provide Disqus Shortname below.
# To disable Disqus comments, simply leave the field empty or remove the next line
disqusShortname = ''
# To disable Disqus comments, simply leave the field empty or remove the next two lines
[services.disqus]
shortname = ''

# set markup.highlight.noClasses=false to enable code highlight
[markup]
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/comments.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Site.DisqusShortname -}}
{{- if .Site.Config.Services.Disqus.Shortname -}}
<hr style="margin-top: 40px; margin-bottom: 40px;" />
{{ template "_internal/disqus.html" . }}
{{- end -}}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
command = "cd exampleSite && hugo --gc --themesDir ../.."

[build.environment]
HUGO_VERSION = "0.116.1"
HUGO_VERSION = "0.122.0"
HUGO_THEME = "repo"

# Deploy Preview context: all deploys generated from
Expand Down

0 comments on commit 9f9c93a

Please sign in to comment.