added sitemap.xml generator

pull/30/head
Scott Anderson 2019-01-23 00:02:28 -07:00
parent 3d97b38009
commit 4b04b8c46b
2 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
baseURL = "http://docs.influxdata.com/"
baseURL = "https://v2.docs.influxdata.com/"
languageCode = "en-us"
title = "InfluxDB Documentation"

21
layouts/sitemap.xml Normal file
View File

@ -0,0 +1,21 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.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 }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{ end }}
</urlset>