Skip to content

Commit

Permalink
fix: replace .Site.BaseURL by recommended alternatives (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys committed Jan 15, 2024
1 parent 4b94d6e commit 785adf0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions exampleSite/content/posts/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.json.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head/others.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions layouts/partials/microformats/schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }},
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/site-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 785adf0

Please sign in to comment.