🌐 Add extra variables to footer for better i18n

pull/14/head
James Panther 2021-10-20 09:31:28 +11:00
parent f9263f5235
commit 0f15206e78
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
3 changed files with 5 additions and 8 deletions

View File

@ -16,7 +16,7 @@ error:
404_description: "It seems that the page you've requested does not exist." 404_description: "It seems that the page you've requested does not exist."
footer: footer:
powered_by: "Powered by {{ .Hugo }}" powered_by: "Powered by {{ .Hugo }} & {{ .Congo }}"
list: list:
externalurl_title: "Link to external site" externalurl_title: "Link to external site"

View File

@ -15,7 +15,7 @@ error:
404_description: "您请求的页面似乎不存在。" 404_description: "您请求的页面似乎不存在。"
footer: footer:
powered_by: "由 {{ .Hugo }} 强力驱动" powered_by: "由 {{ .Hugo }} & {{ .Congo }} 强力驱动"
list: list:
externalurl_title: "链接到外部网站" externalurl_title: "链接到外部网站"

View File

@ -30,13 +30,10 @@
{{ if .Site.Params.attribution | default true }} {{ if .Site.Params.attribution | default true }}
<p class="text-xs text-neutral-300 dark:text-neutral-600"> <p class="text-xs text-neutral-300 dark:text-neutral-600">
{{ $hugo := printf `<a class="hover:underline hover:underline-primary-300 hover:text-primary-400" {{ $hugo := printf `<a class="hover:underline hover:underline-primary-300 hover:text-primary-400"
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a> href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>`
&amp;
<a class="hover:underline hover:underline-primary-300 hover:text-primary-400" href="https://git.io/hugo-congo"
target="_blank" rel="noopener noreferrer">Congo</a>`
}} }}
{{ $congo := printf `<a class="hover:underline hover:underline-primary-300 hover:text-primary-400" href="https://git.io/hugo-congo" target="_blank" rel="noopener noreferrer">Congo</a>` }}
{{ i18n "footer.powered_by" (dict "Hugo" $hugo) | safeHTML }} {{ i18n "footer.powered_by" (dict "Hugo" $hugo "Congo" $congo) | safeHTML }}
</p> </p>
{{ end }} {{ end }}
{{/* Extend footer - eg. for extra scripts, etc. */}} {{/* Extend footer - eg. for extra scripts, etc. */}}