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

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/sitemap.xml')
-rw-r--r--layouts/_default/sitemap.xml57
1 files changed, 35 insertions, 22 deletions
diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml
index 8177b07..b42a7af 100644
--- a/layouts/_default/sitemap.xml
+++ b/layouts/_default/sitemap.xml
@@ -1,29 +1,42 @@
+{{- $pages := .RegularPages -}}
+{{- $pages = where $pages "Params.sitemapexclude" "ne" true -}}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
- {{ range .Site.RegularPages }}
- {{ if not .Params.sitemapExclude }}
- <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>
+ {{ range $pages }}
+
+ <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 }}
- {{ if .IsTranslated }}
- {{ range .Translations }}
- <xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" />
- {{ end }}
- {{ end }}
- </url>
- {{ end }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />
+ {{ end }}
+
+ </url>
+
{{ end }}
</urlset> \ No newline at end of file