mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
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.