Use `site.Home.Permalink` instead of `site.BaseURL` in templates (#1368)

* Update schema_json.html

* Update breadcrumbs.html

---------

Co-authored-by: mumuramuri <149406589+mumuramuri@users.noreply.github.com>
This commit is contained in:
flexxindicomplex 2024-01-07 13:41:23 +03:00 committed by GitHub
parent 21ae19bc2b
commit 71ce72b1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{{- if (.Param "ShowBreadCrumbs") -}}
<div class="breadcrumbs">
{{- $url := replace .Parent.Permalink (printf "%s" site.BaseURL) "" }}
{{- $url := replace .Parent.Permalink (printf "%s" site.Home.Permalink) "" }}
{{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}}
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a>

View File

@ -4,7 +4,7 @@
"@context": "https://schema.org",
"@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}",
"name": {{ site.Title }},
"url": {{ site.BaseURL }},
"url": {{ site.Home.Permalink }},
"description": {{ site.Params.description | plainify | truncate 180 | safeHTML }},
"thumbnailUrl": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }},
"sameAs": [
@ -18,7 +18,7 @@
</script>
{{- else if (or .IsPage .IsSection) }}
{{/* BreadcrumbList */}}
{{- $url := replace .Parent.Permalink ( printf "%s" site.BaseURL) "" }}
{{- $url := replace .Parent.Permalink ( printf "%s" site.Home.Permalink) "" }}
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
{{- $bc_list := (split $lang_url "/")}}