Skip to content

Commit

Permalink
fix: deprecation warnings for recent Hugo versions (#511)
Browse files Browse the repository at this point in the history
* fix: deprecation warnings for Twitter, Google Analytics and Disqus
* chore: bump hugo version on Netlify
  • Loading branch information
lxndrblz committed Jul 18, 2024
1 parent 8f4dfc8 commit 4435557
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG NODE_VERSION=16
FROM mcr.microsoft.com/devcontainers/javascript-node:${NODE_VERSION}

# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo
ARG VARIANT=hugo_extended
# VERSION can be either 'latest' or a specific version number
ARG VERSION=latest

Expand Down
12 changes: 8 additions & 4 deletions exampleSite/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ summarylength = 10
enableEmoji = true
enableRobotsTXT = true

# Enable Disqus
#disqusShortname = ""

# Google Analytics
#googleAnalytics = "UA-123-45"

# Syntax highlighting
pygmentsUseClasses = true
Expand Down Expand Up @@ -46,3 +42,11 @@ localizedDates = false
[[related.indices]]
name = 'tags'
weight = 80

[services]
# Enable Disqus.Disqus.Shortname
[services.disqus]
#shortname = 'your-disqus-shortname'
# Google Analytics
[services.googleAnalytics]
#ID = 'G-MEASUREMENT_ID'
2 changes: 1 addition & 1 deletion exampleSite/content/english/post/rich-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme

## Twitter Simple Shortcode

{{< twitter_simple 1085870671291310081 >}}
{{< twitter user="SanDiegoZoo" id="1453110110599868418" >}}

<br>

Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>{{ title .Title }}</h1>
</div>

{{ if and (or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (ne .Page.Params.disableComments true) }}
{{- if .Site.DisqusShortname -}}
{{- if .Site.Config.Services.Disqus.Shortname -}}
<div id="comment">
<h2>{{ i18n "comments" }}</h2>
{{ template "_internal/disqus.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</footer>
{{- partial "medium-zoom.html" .context -}}
{{- partial "math.html" .context -}}
{{- if (hasPrefix .context.Site.GoogleAnalytics "G-") -}}
{{- if (hasPrefix .context.Site.Config.Services.GoogleAnalytics.ID "G-") -}}
{{- template "_internal/google_analytics.html" .context -}}
{{- end -}}
{{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
command = "cd exampleSite && hugo --gc --minify --themesDir ../.."

[build.environment]
HUGO_VERSION = "0.69.0"
HUGO_VERSION = "0.128.0"
HUGO_ENV = "production"
HUGO_THEME = "repo"
HUGO_BASEURL = "https://anatole-demo.netlify.app"
Expand Down

0 comments on commit 4435557

Please sign in to comment.