fix: new locale params

See #2601
This commit is contained in:
George Cushen 2022-02-14 19:40:12 +00:00
commit ec6d170ce4
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ The **Documentation** starter template empowers you to easily create **product d
[![Discord](https://img.shields.io/discord/722225264733716590?style=for-the-badge)](https://discord.com/channels/722225264733716590/742892432458252370/742895548159492138)
[![Twitter Follow](https://img.shields.io/twitter/follow/wowchemy?label=Follow%20on%20Twitter)](https://twitter.com/wowchemy)
[Check out the latest demo](https://hugo-documentation-theme.netlify.app/) of what you'll get in less than 10 minutes, or [get inspired by how others are using this template](https://wowchemy.com/creators/).
[Check out the latest demo](https://wowchemy.com/docs/) of what you'll get in less than 10 minutes, or [get inspired by how others are using this template](https://wowchemy.com/creators/).
The integrated [**Wowchemy**](https://wowchemy.com) website builder and CMS makes it easy to create a beautiful website for free. Edit your site in the CMS (or your favorite editor), generate it with [Hugo](https://github.com/gohugoio/hugo), and deploy with GitHub or Netlify. Customize anything on your site with widgets, light/dark themes, and language packs.

View file

@ -5,7 +5,7 @@
{{ $page := . }}
{{ $address := .address }}
{{ $format_name := $page.Params.address_format | default site.Params.address_format | default "en-us" }}
{{ $format_name := $page.Params.address_format | default site.Params.locale.address_format | default "en-us" }}
{{ if not (isset site.Data.address_formats $format_name) }}{{ errorf "Address format `%s` missing from `data/address_formats.toml`!" $format_name }}{{end}}

View file

@ -2,7 +2,7 @@
{{ $t1 := time .Date }}{{/* Start datetime. */}}
{{ $str := slice (time.Format site.Params.locale.date_format (time $t1)) }}{{/* Init return string with start date. */}}
{{/* Show start time if not all day event. */}}
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.time_format (time $t1)) }}{{ end }}
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.locale.time_format (time $t1)) }}{{ end }}
{{/* Show event end date if provided. */}}
{{ if .Params.date_end }}
{{ $str = $str | append "—" }}
@ -12,6 +12,6 @@
{{ $str = $str | append (time.Format site.Params.locale.date_format (time $t2)) }}
{{ end }}
{{/* Show end time if not all day event. */}}
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.time_format (time $t2)) }}{{ end }}
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.locale.time_format (time $t2)) }}{{ end }}
{{ end }}
{{ return (delimit $str " ") }}