From ea43359ed79c412dba865780f1c8a4e641081cf0 Mon Sep 17 00:00:00 2001 From: Regis Philibert Date: Thu, 7 Apr 2022 13:32:12 -0400 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Cno"=20localization=20Only=20prin?= =?UTF-8?q?t=20a=20"by"=20for=20some=20languages=20Add=20"by"=20template?= =?UTF-8?q?=20for=20easy=20overwrite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/no.toml | 3 +++ layouts/_default/by.html | 3 +++ layouts/_default/single.html | 14 +++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 layouts/_default/by.html diff --git a/i18n/no.toml b/i18n/no.toml index d6165f6..40b2aca 100644 --- a/i18n/no.toml +++ b/i18n/no.toml @@ -10,6 +10,9 @@ other = "Nyeste {{.Title }}" [readMore] other = "Les mer" +[by] +other = "Av" + [whatsInThis] other = "Innhold av {{ .Type }}" diff --git a/layouts/_default/by.html b/layouts/_default/by.html new file mode 100644 index 0000000..2170065 --- /dev/null +++ b/layouts/_default/by.html @@ -0,0 +1,3 @@ +{{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}} +{{- i18n "by" -}} +{{ end -}} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index adb0c60..a40a4c5 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -20,13 +20,13 @@ {{ with .Params.author | default .Site.Params.author }}

- {{ i18n "by" }} - {{ if reflect.IsSlice . }} - {{ delimit . ", " | markdownify }} - {{else}} - {{ . | markdownify }} - {{ end }} - + {{ $.Render "by" }} + {{- if reflect.IsSlice . -}} + {{ delimit . ", " | markdownify }} + {{- else -}} + {{ . | markdownify }} + {{- end -}} +

{{ end }} {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}