mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
3d60955e17
Use `{{ if not .Date.IsZero }}` to print dates only when they are defined. This is to avoid things like <lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate> and <lastmod>0001-01-01T00:00:00+00:00</lastmod> showing up in index.xml (RSS) and sitemap.xml. Pipe dates with ±hh:mm time zone through `safeHtml` to prevent the `+` sign from turning into `+`. Also make some shuffling to avoid blank lines in the output. |
||
---|---|---|
.. | ||
template.go | ||
template_embedded.go | ||
template_test.go |