浏览代码

Fix + character being written as + (#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
tags/v2.6.3
Adam.S 4 年前
父节点
当前提交
5e250268bd
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      layouts/_default/single.html

+ 1
- 1
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>


正在加载...
取消
保存