From 785adf091b4fc2c301c66ef3fae648048449381a Mon Sep 17 00:00:00 2001 From: Robert Kaussow <mail@thegeeklab.de> Date: Mon, 15 Jan 2024 21:15:17 +0100 Subject: [PATCH] fix: replace .Site.BaseURL by recommended alternatives (#487) --- exampleSite/content/posts/usage/configuration.md | 4 ++-- layouts/404.html | 2 +- layouts/_default/list.json.json | 2 +- layouts/partials/head/others.html | 2 +- layouts/partials/microformats/schema.html | 4 ++-- layouts/partials/site-header.html | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exampleSite/content/posts/usage/configuration.md b/exampleSite/content/posts/usage/configuration.md index 4aafb5fa..685f670a 100644 --- a/exampleSite/content/posts/usage/configuration.md +++ b/exampleSite/content/posts/usage/configuration.md @@ -109,7 +109,7 @@ enableRobotsTXT = true # by the 'img' shortcode. geekblogImageLazyLoading = true - # (Optional, default false) Set HTMl <base> to .Site.BaseURL if enabled. It might be required + # (Optional, default false) Set HTMl <base> to .Site.Home.Permalink if enabled. It might be required # if a subdirectory is used within Hugo's BaseURL. # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. geekblogOverwriteHTMLBase = false @@ -249,7 +249,7 @@ params: # by the 'img' shortcode. geekblogImageLazyLoading: true - # (Optional, default false) Set HTMl <base> to .Site.BaseURL if enabled. It might be required + # (Optional, default false) Set HTMl <base> to .Site.Home.Permalink if enabled. It might be required # if a subdirectory is used within Hugo's BaseURL. # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. geekblogOverwriteHTMLBase: false diff --git a/layouts/404.html b/layouts/404.html index 75205ab2..dc3fa471 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -21,7 +21,7 @@ <div class="gblog-error__line gblog-error__code">Error 404</div> <div class="gblog-error__line gblog-error__help"> Seems like what you are looking for can't be found. Don't worry we can bring you back - to the <a class="gblog-error__link" href="{{ .Site.BaseURL }}">homepage</a>. + to the <a class="gblog-error__link" href="{{ .Site.Home.Permalink }}">homepage</a>. </div> </div> </div> diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index 94e803c6..08af28f4 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -8,7 +8,7 @@ {{- with .Site.Params.subtitle }} "description": {{ . | jsonify }}, {{- end }} - "home_page_url" : "{{ .Site.BaseURL }}", + "home_page_url" : "{{ .Site.Home.Permalink }}", {{- with .OutputFormats.Get "json" }} "feed_url" : "{{ .Permalink }}", {{- end }} diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index c4f06360..ac359b48 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -79,7 +79,7 @@ {{- end }} {{- if (default false $.Site.Params.geekblogOverwriteHTMLBase) }} - <base href="{{ .Site.BaseURL }}" /> + <base href="{{ .Site.Home.Permalink }}" /> {{- end }} {{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/thegeeklab/hugo-geekblog" | safeHTML }} diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html index 2ab18e5c..50f48f2a 100644 --- a/layouts/partials/microformats/schema.html +++ b/layouts/partials/microformats/schema.html @@ -7,7 +7,7 @@ {{ with index $.Site.Data.authors . }}"author": "{{ .name }}",{{ end }} {{- end }} "name": {{ .Site.Title }}, - "url": {{ .Site.BaseURL }}, + "url": {{ .Site.Home.Permalink }}, {{- with partial "utils/description" . }} "description": "{{ . | plainify | htmlUnescape | chomp }}", {{- end }} @@ -77,7 +77,7 @@ "publisher":{ "@type":"Organization", "name": {{ .Site.Title }}, - "url": {{ .Site.BaseURL }}, + "url": {{ .Site.Home.Permalink }}, "logo": { "@type": "ImageObject", "url": {{ (default "brand.svg" .Site.Params.logo) | absURL }}, diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index 3efd8819..3a847f06 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -2,7 +2,7 @@ <div class="container flex flex-wrap"> <div class="gblog-header__col-1 flex justify-start hidden-mobile"></div> <div class="gblog-header__col-2 flex align-center justify-center "> - <a class="gblog-header__link" rel="me" href="{{ .Site.BaseURL }}"> + <a class="gblog-header__link" rel="me" href="{{ .Site.Home.Permalink }}"> <span class="gblog-brand flex align-center justify-center"> <img class="gblog-brand__img"