Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pjbakker/flexible-seo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paul@brainspark.nl>2020-06-09 17:57:09 +0300
committerPaul <paul@brainspark.nl>2020-06-09 17:57:59 +0300
commit28ae7440c50885fa17a720e35741cd28dfaf2ee3 (patch)
tree7f57c3aa7d8da31117429e68968ccdceee84ff18
parentca78f13c872ffc7a6dbbd2ede26fb7a50d8d6754 (diff)
Add sitemap template that can also exclude items with 'private: true'
-rw-r--r--layouts/sitemap.xml12
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>