diff options
author | Paul <paul@brainspark.nl> | 2020-06-09 17:57:09 +0300 |
---|---|---|
committer | Paul <paul@brainspark.nl> | 2020-06-09 17:57:59 +0300 |
commit | 28ae7440c50885fa17a720e35741cd28dfaf2ee3 (patch) | |
tree | 7f57c3aa7d8da31117429e68968ccdceee84ff18 | |
parent | ca78f13c872ffc7a6dbbd2ede26fb7a50d8d6754 (diff) |
Add sitemap template that can also exclude items with 'private: true'
-rw-r--r-- | layouts/sitemap.xml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml new file mode 100644 index 0000000..8a2a91e --- /dev/null +++ b/layouts/sitemap.xml @@ -0,0 +1,12 @@ +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + {{ range .Data.Pages }} + {{ if not .Params.private }} + <url> + <loc>{{ .Permalink }}</loc> + <lastmod>{{ safeHTML ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }} + <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + <priority>{{ .Sitemap.Priority }}</priority>{{ end }} + </url> + {{ end }} + {{ end }} +</urlset> |