File tree Expand file tree Collapse file tree
layouts/partials/post_meta Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,16 @@ Full list of available default post meta fields:
8080In addition to the default meta fields, you can add your own by placing a custom partial under
8181` layouts/partials/post_meta/<name>.html ` .
8282
83+ #### Post meta: ` date ` localization
84+
85+ With [ Hugo v0.87.0] ( https://gohugo.io/news/0.87.0-relnotes/ ) (or later), ` date ` meta field shows localized dates (with
86+ weekdays and months in the current language) by default. In most cases, such a transition is painless, but owners of
87+ multilingual sites should be careful and check that everything translates as expected after the upgrade.
88+
89+ You can also use a predefined layout, like ` :date_full ` , and it will output localized dates or times. For additional
90+ information about localized dates and possible date/time formatting layouts, please see
91+ [ Hugo: time.Format] ( https://gohugo.io/functions/dateformat/ ) .
92+
8393### Thumbnail visibility
8494
8595By default, a thumbnail image has shown for a list and single pages simultaneously. In some cases, you may want to show
Original file line number Diff line number Diff line change 22< div class ="meta__item-datetime meta__item ">
33 {{ partial "svg/time.svg" (dict "class" "meta__icon") -}}
44 < time class ="meta__text " datetime ="{{ .Date.Format "2006-01-02T15:04:05Z07:00 " }}">
5- {{- .Date.Format (.Site.Params.dateformat | default "January 02, 2006") -}}
5+ {{- .Date | dateFormat (.Site.Params.dateformat | default "January 02, 2006") -}}
66 </ time >
77 {{- if ne .Date .Lastmod }}
88 < time class ="meta__text " datetime ="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00 " }}"> (
9- {{- T "meta_lastmod" }}: {{ .Lastmod.Format (.Site.Params.dateformat | default "January 02, 2006") -}}
9+ {{- T "meta_lastmod" }}: {{ .Lastmod | dateFormat (.Site.Params.dateformat | default "January 02, 2006") -}}
1010 )</ time >
1111 {{- end -}}
1212</ div >
You can’t perform that action at this time.
0 commit comments