forked from gohugoio/hugo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use .Date.IsZero to skip unset date in embedded templates
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 `&gohugoio#43;`. Also make some shuffling to avoid blank lines in the output.
- Loading branch information
1 parent
5719c24
commit 84089e9
Showing
1 changed file
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters