theme: sync to Hugo changes for PublishDate #872

This commit is contained in:
Sören Weber 2024-06-30 10:54:48 +02:00
parent 6f24d34f44
commit 8894539070
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
3 changed files with 3 additions and 3 deletions

View file

@ -47,7 +47,7 @@
<item> <item>
<title>{{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) }}</title> <title>{{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) }}</title>
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link> <link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ (or .PublishDate .Date).Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</guid> <guid>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</guid>
<description>{{ or .Description .Summary | plainify | htmlUnescape | chomp | transform.XMLEscape | safeHTML }}</description> <description>{{ or .Description .Summary | plainify | htmlUnescape | chomp | transform.XMLEscape | safeHTML }}</description>

View file

@ -29,7 +29,7 @@
<meta property="article:section" content="{{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) | plainify }}"> <meta property="article:section" content="{{ partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) | plainify }}">
{{- end }} {{- end }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" }} {{- $iso8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }} {{- with or .PublishDate .Date }}
<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}> <meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }} {{- end }}
{{- with .Lastmod }} {{- with .Lastmod }}

View file

@ -10,7 +10,7 @@
{{- end }} {{- end }}
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }} {{- with or .PublishDate .Date }}
<meta itemprop="datePublished" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}> <meta itemprop="datePublished" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }} {{- end }}