Skip to content

Commit

Permalink
Fix date format in internal schema template
Browse files Browse the repository at this point in the history
Prior to this change, the offset indicator for dates with positive
offsets was rendered as + instead of +.

Fixes #7495
  • Loading branch information
jmooring authored and bep committed Jul 23, 2020
1 parent 0256959 commit a06c06a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tpl/tplimpl/embedded/templates.autogen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tpl/tplimpl/embedded/templates/schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">

{{- if .IsPage }}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if not .PublishDate.IsZero }}
<meta itemprop="datePublished" content="{{ .PublishDate.Format $ISO8601 | safeHTML }}" />{{ end }}
{{ if not .Lastmod.IsZero }}<meta itemprop="dateModified" content="{{ .Lastmod.Format $ISO8601 | safeHTML }}" />{{ end }}
<meta itemprop="datePublished" {{ .PublishDate.Format $ISO8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{ if not .Lastmod.IsZero }}<meta itemprop="dateModified" {{ .Lastmod.Format $ISO8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
<meta itemprop="wordCount" content="{{ .WordCount }}">
{{ with $.Params.images }}{{ range first 6 . -}}
<meta itemprop="image" content="{{ . | absURL }}">
Expand All @@ -20,4 +20,4 @@

<!-- Output all taxonomies as schema.org keywords -->
<meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
{{- end }}
{{- end }}

0 comments on commit a06c06a

Please # to comment.