fix: replace .Site.BaseURL by recommended alternatives (#761)

This commit is contained in:
Robert Kaussow 2024-01-07 16:24:22 +01:00 committed by GitHub
parent e11f0c891c
commit eae99409b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 11 deletions

View file

@ -67,7 +67,7 @@
{{- end }}
{{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }}
<base href="{{ .Site.BaseURL }}" />
<base href="{{ .Site.Home.Permalink }}" />
{{- end }}
{{ printf "<!-- %s -->" "Made with Geekdoc theme https://github.com/thegeeklab/hugo-geekdoc" | safeHTML }}

View file

@ -5,7 +5,7 @@
"@context": "http://schema.org",
"@type": "WebSite",
"name": {{ .Site.Title }},
"url": {{ .Site.BaseURL }},
"url": {{ .Site.Home.Permalink }},
{{- with partial "utils/description" . }}
"description": "{{ . | plainify | htmlUnescape | chomp }}",
{{- end }}
@ -57,7 +57,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 }},

View file

@ -8,7 +8,7 @@
placeholder="{{ i18n "form_placeholder_search" }}..."
aria-label="{{ i18n "form_placeholder_search" }}"
maxlength="64"
data-site-base-url="{{ .Site.BaseURL }}"
data-site-base-url="{{ "" | absURL }}"
data-site-lang="{{ .Site.Language.Lang }}"
/>
<ul id="gdoc-search-results" class="gdoc-search__list"></ul>

View file

@ -13,7 +13,7 @@
</label>
{{ end }}
<div>
<a class="gdoc-brand gdoc-header__link" href="{{ .Root.Site.BaseURL }}">
<a class="gdoc-brand gdoc-header__link" href="{{ .Root.Site.Home.Permalink }}">
<span class="flex align-center">
<img
class="gdoc-brand__img"
@ -47,7 +47,7 @@
</span>
<span class="gdoc-menu-header__home">
<a href="{{ .Root.Site.BaseURL }}" class="gdoc-header__link">
<a href="{{ .Root.Site.Home.Permalink }}" class="gdoc-header__link">
<svg class="gdoc-icon gdoc_home">
<title>{{ i18n "button_homepage" }}</title>
<use xlink:href="#gdoc_home"></use>