i18n: support for languageCode and standard Hugo options

This commit is contained in:
Sören Weber 2023-11-28 21:31:35 +01:00
parent 5d058ea7ba
commit 42b604b4fb
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
8 changed files with 11 additions and 22 deletions
exampleSite/layouts/partials/shortcodes

View file

@ -7,7 +7,7 @@
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
{{- $writenotice := cond (ne .writenotice nil) .writenotice false }}
{{- $langtrg := "pir" }}
{{- $langsrc := cond (eq $page.Lang $langtrg) (.langsrc | default "en") $page.Lang }}
{{- $langsrc := cond (eq $page.Language.Lang $langtrg) (.langsrc | default "en") $page.Language.Lang }}
{{- $baseURL := urls.Parse site.BaseURL }}
{{- $baseURLpath := $baseURL.Path | default "/" }}
{{- $l := $page.RelPermalink }}
@ -34,7 +34,7 @@
{{- break }}
{{- end }}
{{- end }}
{{- if eq $page.Lang $langtrg }}
{{- if eq $page.Language.Lang $langtrg }}
{{- if $writenotice }}
{{- partial "shortcodes/notice.html" (dict
"page" $page