Skip to content

Commit

Permalink
Add “no" localization
Browse files Browse the repository at this point in the history
Only print a "by" for some languages
Add "by" template for easy overwrite
  • Loading branch information
regisphilibert committed Apr 7, 2022
1 parent 84011f4 commit ea43359
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions i18n/no.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ other = "Nyeste {{.Title }}"
[readMore]
other = "Les mer"

[by]
other = "Av"

[whatsInThis]
other = "Innhold av {{ .Type }}"

Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/by.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}}
{{- i18n "by" -}}
{{ end -}}
14 changes: 7 additions & 7 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ <h1 class="f1 athelas mt3 mb1">
</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 */}}
Expand Down

0 comments on commit ea43359

Please sign in to comment.