mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
18.25.2024 4435557b80dd5b8f9ff5a391fb9a128254c13ffb
fix: deprecation warnings for recent Hugo versions (#511)

* fix: deprecation warnings for Twitter, Google Analytics and Disqus
* chore: bump hugo version on Netlify
6 files modified
22 ■■■■■ changed files
.devcontainer/Dockerfile 2 ●●● patch | view | raw | blame | history
exampleSite/config/_default/config.toml 12 ●●●●● patch | view | raw | blame | history
exampleSite/content/english/post/rich-content.md 2 ●●● patch | view | raw | blame | history
layouts/_default/single.html 2 ●●● patch | view | raw | blame | history
layouts/partials/footer.html 2 ●●● patch | view | raw | blame | history
netlify.toml 2 ●●● patch | view | raw | blame | history
.devcontainer/Dockerfile
@@ -3,7 +3,7 @@
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
exampleSite/config/_default/config.toml
@@ -12,11 +12,7 @@
enableEmoji = true
enableRobotsTXT = true
# Enable Disqus
#disqusShortname = ""
# Google Analytics
#googleAnalytics = "UA-123-45"
# Syntax highlighting
pygmentsUseClasses = true   
@@ -46,3 +42,11 @@
[[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'
exampleSite/content/english/post/rich-content.md
@@ -23,7 +23,7 @@
## Twitter Simple Shortcode
{{< twitter_simple 1085870671291310081 >}}
{{< twitter user="SanDiegoZoo" id="1453110110599868418" >}}
<br>
layouts/_default/single.html
@@ -77,7 +77,7 @@
    </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" . }}
layouts/partials/footer.html
@@ -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) -}}
netlify.toml
@@ -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"