diff options
author | Emiel Hollander <EmielH@users.noreply.github.com> | 2018-10-07 10:21:01 +0300 |
---|---|---|
committer | Emiel Hollander <EmielH@users.noreply.github.com> | 2018-10-07 10:21:01 +0300 |
commit | 5d20e1cae14ed1c025c536ecfbbb21cc2d7efbe6 (patch) | |
tree | cb89a85c078b2c17a69a5e6b26ef1216dfead0d1 | |
parent | 7ffbe45d665c34048803bb21b8e3002c8b605e94 (diff) |
Add localisation option for publishdate
-rw-r--r-- | data/months_nl.yaml | 12 | ||||
-rw-r--r-- | i18n/en.toml | 5 | ||||
-rw-r--r-- | i18n/nl.toml | 5 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 |
5 files changed, 22 insertions, 4 deletions
diff --git a/data/months_nl.yaml b/data/months_nl.yaml new file mode 100644 index 0000000..c979892 --- /dev/null +++ b/data/months_nl.yaml @@ -0,0 +1,12 @@ +1: "januari" +2: "februari" +3: "maart" +4: "april" +5: "mei" +6: "juni" +7: "juli" +8: "augustus" +9: "september" +10: "oktober" +11: "november" +12: "december"
\ No newline at end of file diff --git a/i18n/en.toml b/i18n/en.toml index d3a0bb7..e7de9a3 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -11,4 +11,7 @@ other = "Written by" other = "on" [generator] -other = "Made with <a href='https://gohugo.io'>Hugo</a> using the <a href='https://github.com/EmielH/tale-hugo/'>Tale</a> theme."
\ No newline at end of file +other = "Made with <a href='https://gohugo.io'>Hugo</a> using the <a href='https://github.com/EmielH/tale-hugo/'>Tale</a> theme." + +[publishdate] +other = "{{ .PublishDate.Format \"January 2, 2006\" }}"
\ No newline at end of file diff --git a/i18n/nl.toml b/i18n/nl.toml index 9c5c8f7..29c5b75 100644 --- a/i18n/nl.toml +++ b/i18n/nl.toml @@ -11,4 +11,7 @@ other = "Geschreven door" other = "op" [generator] -other = "Gemaakt met <a href='https://gohugo.io'>Hugo</a> en thema <a href='https://github.com/EmielH/tale-hugo/'>Tale</a>."
\ No newline at end of file +other = "Gemaakt met <a href='https://gohugo.io'>Hugo</a> en thema <a href='https://github.com/EmielH/tale-hugo/'>Tale</a>." + +[publishdate] +other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_nl (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6e46c07..9134f96 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,7 +12,7 @@ {{- if .PublishDate }} <br> - <span>{{ i18n "on" }} </span><time datetime="{{ .PublishDate }}">{{ .PublishDate.Format "January 2, 2006" }}</time> + <span>{{ i18n "on" }} </span><time datetime="{{ .PublishDate }}">{{ i18n "publishdate" . }}</time> {{- end }} </div> diff --git a/layouts/index.html b/layouts/index.html index 94c114a..5d946f5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,7 +5,7 @@ {{ range (.Paginate .Pages).Pages }} <a href="{{ .Permalink }}" class="catalogue-item"> <div> - <time datetime="{{ .PublishDate }}" class="catalogue-time">{{ .PublishDate.Format "January 2, 2006" }}</time> + <time datetime="{{ .PublishDate }}" class="catalogue-time">{{ i18n "publishdate" . }}</time> <h1 class="catalogue-title">{{ .Title }}</h1> <div class="catalogue-line"></div> |