Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/budparr/gohugo-theme-ananke.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam.S <Bas-Man@users.noreply.github.com>2020-07-20 16:43:05 +0300
committerGitHub <noreply@github.com>2020-07-20 16:43:05 +0300
commit5e250268bd1bf333672bd111c070cef88f963247 (patch)
tree3cf3c5d54acfc23a36594f906a265936a35b7bc1
parentb4f40ded77fc379387b5305e846720092749c2ba (diff)
Fix + character being written as &#43; (#317)
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 https://github.com/gohugoio/hugo/issues/7488
-rwxr-xr-xlayouts/_default/single.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index e63f129..cbb7e74 100755
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -30,7 +30,7 @@
</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>