Skip to content

Commit

Permalink
Fix + character being written as &theNewDynamic#43; (theNewDynamic#317)
Browse files Browse the repository at this point in the history
The existing template code results in the + chartering being written in a form that is not valid for the datetime element when used in and <time> tag.

This patch fixes this issue.
references:
https://discourse.gohugo.io/t/date-lastmod-return-43-in-place-of/27033
gohugoio/hugo#7488
  • Loading branch information
Bas-Man authored and Remicck committed Mar 7, 2022
1 parent d677828 commit 56852c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1 class="f1 athelas mt3 mb1">
</p>
{{ end }}
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
<time class="f6 mv4 dib tracked" {{ printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safeHTMLAttr }}>
{{- .Date.Format "January 2, 2006" -}}
</time>

Expand Down

0 comments on commit 56852c1

Please sign in to comment.