From 913c331be99deb3a632593db386963bff6576c96 Mon Sep 17 00:00:00 2001
From: hydr0nium <37932436+hydr0nium@users.noreply.github.com>
Date: Wed, 10 Jul 2024 02:03:00 +0200
Subject: [PATCH 1/6] Fixed deprecated site.isServer param to hugo.isServer
param
---
layouts/partials/head.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 8c4de22b..23c8c5e4 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -97,6 +97,6 @@
{{- end -}}
{{- partial "head_custom.html" . }}
-{{- if not .Site.IsServer -}}
+{{- if not hugo.IsServer -}}
{{ template "_internal/google_analytics.html" . }}
{{- end -}}
From 88ed6c7efbe108ec61a303bd6b02d6adae0f4e6d Mon Sep 17 00:00:00 2001
From: hydr0nium <37932436+hydr0nium@users.noreply.github.com>
Date: Wed, 10 Jul 2024 12:14:33 +0200
Subject: [PATCH 2/6] Also fixed another deprecated function for disqus
---
layouts/partials/disqus.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
index 80295259..f8948e78 100644
--- a/layouts/partials/disqus.html
+++ b/layouts/partials/disqus.html
@@ -1,7 +1,7 @@
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (.Site.Params.comments)) }}
- {{ if .Site.DisqusShortname }}
+ {{ if .Site.Config.Services.Disqus.Shortname }}
{{ end }}
-{{ end }}
\ No newline at end of file
+{{ end }}
From 46efdedda785e91785a733f21fda6cb15f75981f Mon Sep 17 00:00:00 2001
From: hydr0nium <37932436+hydr0nium@users.noreply.github.com>
Date: Wed, 10 Jul 2024 13:01:01 +0200
Subject: [PATCH 3/6] Updated README.md
In the face of that we will update to 0.120 it would also be nice to update the README to reference the hugo.* file as the config instead of the config.* file.
I also changed the description of the disqus feature to match the updated version of the code
---
README.md | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index cd5fdd91..d6fd30ab 100644
--- a/README.md
+++ b/README.md
@@ -87,13 +87,21 @@ Client side highlighting does not require pygments to be installed. This will us
### Disqus support
-To use this feature, uncomment and fill out the `disqusShortname` parameter in `config.toml`.
+To use this feature add your disqus shortname to the hugo.toml file like this:
+
+```toml
+[services]
+ [services.disqus]
+ shortname = ''
+```
+
+For further reference see [hugo config](https://gohugo.io/methods/site/config/)
### Staticman support
-Add *Staticman* configuration section in `config.toml` or `config.yaml`
+Add *Staticman* configuration section in `hugo.toml` or `hugo.yaml`
-Sample `config.toml` configuration
+Sample `hugo.toml` configuration
```
[Params.staticman]
@@ -134,26 +142,26 @@ comments:
secret: "hsGjWtWHR4HK4pT7cUsWTArJdZDxxE2pkdg/ArwCguqYQrhuubjj3RS9C5qa8xu4cx/Y9EwHwAMEeXPCZbLR9eW1K9LshissvNcYFfC/b8KKb4deH4V1+oqJEk/JcoK6jp6Rr2nZV4rjDP9M7nunC3WR5UGwMIYb8kKhur9pAic="
```
-If you *don't* have the section `[Params.staticman]` in `config.toml`, you *won't* need the section `reCaptcha` in `staticman.yml`
+If you *don't* have the section `[Params.staticman]` in `hugo.toml`, you *won't* need the section `reCaptcha` in `staticman.yml`
### Site Disclaimer
If you need to put a Disclaimer on your website (e.g. "My views are my own and not my employer's"), you can do so via the following:
-* Uncomment and edit the `disclaimerText` parameter in `config.toml`.
+* Uncomment and edit the `disclaimerText` parameter in `hugo.toml`.
* If you need to adjust the disclaimer's styling, modify the declarations within the `footer div.disclaimer` selector in `static/css/main.css`.
> The code for the disclaimer text is in `layouts/partials/footer.html`. Moving this code block to another partial file (or relocating it within `footer.html`) will require changes to the css selector in `main.css` as well.
### Google Analytics
-To add Google Analytics, simply sign up to [Google Analytics](https://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `googleAnalytics` parameter in `config.toml`.
+To add Google Analytics, simply sign up to [Google Analytics](https://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `googleAnalytics` parameter in `hugo.toml`.
Note that the Google Analytics tracking code will only be inserted into the page when the site isn't served on Hugo's built-in server, to prevent tracking from local testing environments.
### Commit SHA on the footer
-If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two site parameters `commit` has to be defined in the config file `config.toml`:
+If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two site parameters `commit` has to be defined in the config file `hugo.toml`:
```
enableGitInfo = true
@@ -166,7 +174,7 @@ See at [vincenttam/vincenttam.gitlab.io](https://gitlab.com/vincenttam/vincentta
### Multilingual
To allow Beautiful Hugo to go multilingual, you need to define the languages
-you want to use inside the `languages` parameter on `config.toml` file, also
+you want to use inside the `languages` parameter on `hugo.toml` file, also
redefining the content dir for each one. Check the `i18n/` folder to see all
languages available.
@@ -194,7 +202,7 @@ content/ content/ content/
With default settings, visiting to a website using Beautifulhugo connects also to remote services like google fonts or jsdelivr to embed fonts, js and other assets.
-To avoid this, set the following param in config.toml:
+To avoid this, set the following param in hugo.toml:
```
[Params]
@@ -229,7 +237,7 @@ This is column 2.
### Social Media Icons
-In order to show social media icons in the footer, add a section like this to your `config.yaml`. You can see the full list of supported social media sites in `data/beautifulhugo/social.toml`.
+In order to show social media icons in the footer, add a section like this to your `hugo.yaml` or `hugo.toml`. You can see the full list of supported social media sites in `data/beautifulhugo/social.toml`.
```yaml
author:
@@ -238,6 +246,17 @@ author:
github: halogenica/beautifulhugo
twitter: username
discord: 96VAXXvjCB
+ ...
+```
+
+```toml
+[Author]
+ name = "Author Name"
+ website = "https://example.com"
+ github = "halogenica/beautifulhugo"
+ twitter = "username"
+ discord = "96VAXXvjCB"
+ ...
```
## About
From 8ed9be3a4e987c8317f863ba32af599b9621bb2e Mon Sep 17 00:00:00 2001
From: hydr0nium <37932436+hydr0nium@users.noreply.github.com>
Date: Thu, 11 Jul 2024 17:50:15 +0200
Subject: [PATCH 4/6] Added checks for hugoVersion and disqus feature
---
layouts/_default/baseof.html | 9 +++++++++
layouts/_default/single.html | 2 +-
layouts/partials/footer.html | 7 ++++---
netlify.toml | 2 +-
theme.toml | 2 +-
5 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index a67d0c4b..ad0230fa 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,3 +1,12 @@
+{{ if le hugo.Version "0.120.0" }}
+ {{ errorf "Please use Hugo version 0.120.0 or higher!"}}
+{{ end }}
+
+{{ if not (eq .Site.DisqusShortname "") }}
+ {{ errorf "Your use of disqusShortname is deprecated by Hugo; Please reference the README.md for further instructions.
+ This error message will be removed in the future because we are also using .Site.DisqusShortname for checking this."}}
+{{ end }}
+
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index b5718e77..975a79ad 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -61,7 +61,7 @@ {{ i18n "seeAlso" }}
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
- {{ if .Site.DisqusShortname }}
+ {{ if .Site.Config.Services.Disqus.Shortname }}
{{ if .Site.Params.delayDisqus }}