diff options
author | Regis Philibert <login@regisphilibert.com> | 2022-04-07 20:32:12 +0300 |
---|---|---|
committer | Regis Philibert <login@regisphilibert.com> | 2022-04-07 20:32:12 +0300 |
commit | ea43359ed79c412dba865780f1c8a4e641081cf0 (patch) | |
tree | 07edceb2fc04f6b64cc5b9a8b357c9c86cad7147 | |
parent | 84011f418d7eb6c2ef870efc3f6fbd4a93d30985 (diff) |
Add “no" localization528-localize-by
Only print a "by" for some languages
Add "by" template for easy overwrite
-rw-r--r-- | i18n/no.toml | 3 | ||||
-rw-r--r-- | layouts/_default/by.html | 3 | ||||
-rwxr-xr-x | layouts/_default/single.html | 14 |
3 files changed, 13 insertions, 7 deletions
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 @@ </h1> {{ with .Params.author | default .Site.Params.author }} <p class="tracked"> - {{ i18n "by" }} <strong> - {{ if reflect.IsSlice . }} - {{ delimit . ", " | markdownify }} - {{else}} - {{ . | markdownify }} - {{ end }} - </strong> + {{ $.Render "by" }} <strong> + {{- if reflect.IsSlice . -}} + {{ delimit . ", " | markdownify }} + {{- else -}} + {{ . | markdownify }} + {{- end -}} + </strong> </p> {{ end }} {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} |