Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/budparr/gohugo-theme-ananke.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegis Philibert <login@regisphilibert.com>2022-04-07 20:32:12 +0300
committerRegis Philibert <login@regisphilibert.com>2022-04-07 20:32:12 +0300
commitea43359ed79c412dba865780f1c8a4e641081cf0 (patch)
tree07edceb2fc04f6b64cc5b9a8b357c9c86cad7147
parent84011f418d7eb6c2ef870efc3f6fbd4a93d30985 (diff)
Add “no" localization528-localize-by
Only print a "by" for some languages Add "by" template for easy overwrite
-rw-r--r--i18n/no.toml3
-rw-r--r--layouts/_default/by.html3
-rwxr-xr-xlayouts/_default/single.html14
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 */}}