From 7551142f3a44c8036f64637f753f4fcde2c308af Mon Sep 17 00:00:00 2001
From: Andreas Deininger <andreas@deininger.net>
Date: Thu, 25 Apr 2024 17:38:45 +0000
Subject: [PATCH] Fix deprecation warning emitted by hugo (#903)
---
docs/configurations.md | 2 ++
layouts/partials/posts/disqus.html | 4 ++--
exampleSite/hugo.toml | 5 ++++-
docs/quick-start.md | 2 +-
netlify.toml | 2 +-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/docs/configurations.md b/docs/configurations.md
index 2cd5691..37a1a34 100644
--- a/docs/configurations.md
+++ b/docs/configurations.md
@@ -258,6 +258,8 @@
paginate = 20
+[services]
+[services.disqus]
disqusShortname = "yourdiscussshortname"
[markup.highlight]
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 4d7267f..b52d76f 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -3,7 +3,7 @@
To start using `hugo-coder`:
1. Add the repository into your Hugo Project repository as a submodule, `git submodule add https://github.com/luizdepra/hugo-coder.git themes/coder`.
-2. Configure your `config.toml`. You can use [this minimal configuration](https://github.com/luizdepra/hugo-coder/blob/main/docs/configurations.md#complete-example) as a base. The [`config.toml`](https://github.com/luizdepra/hugo-coder/blob/master/exampleSite/config.toml) inside the [exampleSite](https://github.com/luizdepra/hugo-coder/tree/master/exampleSite) from the `exampleSite` is also a good reference.
+2. Configure your `config.toml`. You can use [this minimal configuration](https://github.com/luizdepra/hugo-coder/blob/main/docs/configurations.md#complete-example) as a base. The [`hugo.toml`](https://github.com/luizdepra/hugo-coder/blob/master/exampleSite/hugo.toml) inside the [exampleSite](https://github.com/luizdepra/hugo-coder/tree/master/exampleSite) from the `exampleSite` is also a good reference.
3. Build your site with `hugo serve` and see the result at `http://localhost:1313/`.
If you just want to test this theme, go to [this page](https://themes.gohugo.io/themes/hugo-coder/).
diff --git a/exampleSite/config.toml b/exampleSite/hugo.toml
similarity index 98%
rename from exampleSite/config.toml
rename to exampleSite/hugo.toml
index 6e88179..eb6a802 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/hugo.toml
@@ -5,8 +5,11 @@
defaultContentLanguage = "en"
paginate = 6
enableEmoji = true
+
+[services]
+[services.disqus]
# Enable Disqus comments
-# disqusShortname = "yourdiscussshortname"
+# shortname = "yourdiscussshortname"
[markup.highlight]
noClasses = false
diff --git a/layouts/partials/posts/disqus.html b/layouts/partials/posts/disqus.html
index d0b5242..0e18a0b 100644
--- a/layouts/partials/posts/disqus.html
+++ b/layouts/partials/posts/disqus.html
@@ -1,4 +1,4 @@
-{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
+{{- if and (not (eq (.Site.Config.Services.Disqus.Shortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
<div id="disqus_thread"></div>
<script>
window.disqus_config = function () {
@@ -12,7 +12,7 @@
return;
}
var d = document, s = d.createElement('script'); s.async = true;
- s.src = '//' + {{ .Site.DisqusShortname }} + '.disqus.com/embed.js';
+ s.src = '//' + {{ .Site.Config.Services.Disqus.Shortname }} + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
diff --git a/netlify.toml b/netlify.toml
index ef2bf2e..cee9682 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,7 +3,7 @@
command = "cd exampleSite && hugo --themesDir=../.. --baseURL $URL"
[build.environment]
-HUGO_VERSION = "0.111.3"
+HUGO_VERSION = "0.124.1"
HUGO_THEME = "repo"
[context.deploy-preview]
--
Gitblit v1.10.0