mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-12 18:14:45 -04:00
Update sitemap-template.md
This commit is contained in:
parent
aae33d9a8f
commit
f3417dd52f
@ -45,7 +45,7 @@ For multilingual sites, we also create a Sitemap index. You can provide a custom
|
|||||||
|
|
||||||
This template respects the version 0.9 of the [Sitemap Protocol](http://www.sitemaps.org/protocol.html).
|
This template respects the version 0.9 of the [Sitemap Protocol](http://www.sitemaps.org/protocol.html).
|
||||||
|
|
||||||
```
|
```xml
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
<url>
|
<url>
|
||||||
@ -65,6 +65,23 @@ on render. Please don't include this in the template as it's not valid HTML.
|
|||||||
`<?xml version="1.0" encoding="utf-8" standalone="yes" ?>`
|
`<?xml version="1.0" encoding="utf-8" standalone="yes" ?>`
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
## Hugo's sitemapindex.xml
|
||||||
|
|
||||||
|
This is used to create a Sitemap index in multilingual mode:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
{{ range . }}
|
||||||
|
<sitemap>
|
||||||
|
<loc>{{ .SitemapAbsURL }}</loc>
|
||||||
|
{{ if not .LastChange.IsZero }}
|
||||||
|
<lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
|
||||||
|
{{ end }}
|
||||||
|
</sitemap>
|
||||||
|
{{ end }}
|
||||||
|
</sitemapindex>
|
||||||
|
```
|
||||||
|
|
||||||
## Configure `sitemap.xml`
|
## Configure `sitemap.xml`
|
||||||
|
|
||||||
Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in the site's config file, e.g.:
|
Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in the site's config file, e.g.:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user