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

github.com/pfadfinder-konstanz/hugo-dpsg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Mehl <mail@mehl.mx>2020-11-03 11:22:24 +0300
committerMax Mehl <mail@mehl.mx>2020-11-03 11:22:24 +0300
commit9d6822b6fe06804f3b2637352b100b980eb77a69 (patch)
treecd8b0510fad9c355f4b8c6388580f26c49b8d385
parent055443ac8c8f44f487d05421dcac98cabc2f71d2 (diff)
allow to hide content from sitemap
-rw-r--r--README.md1
-rw-r--r--layouts/sitemap.xml23
2 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 59950d6..3ad7832 100644
--- a/README.md
+++ b/README.md
@@ -176,6 +176,7 @@ widgets: # Enable sidebar widgets in given order per page
- "search"
- "recent"
- "taglist"
+sitemap_hide: false # Do not add this page to the sitemap
---
```
diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml
new file mode 100644
index 0000000..5973853
--- /dev/null
+++ b/layouts/sitemap.xml
@@ -0,0 +1,23 @@
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ {{- range .Data.Pages -}}
+ {{ if ne .Params.sitemap_hide true }}
+ <url>
+ <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
+ <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
+ <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
+ <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ </url>
+ {{ end }}
+ {{- end -}}
+</urlset>