2017-10-01 03:51:43 +00:00
|
|
|
+++
|
|
|
|
title = "Sitemap"
|
|
|
|
weight = 60
|
|
|
|
+++
|
|
|
|
|
2018-10-18 21:09:32 +00:00
|
|
|
Zola will look for a `sitemap.xml` file in the `templates` directory or
|
2017-10-01 03:51:43 +00:00
|
|
|
use the built-in one.
|
|
|
|
|
2019-03-14 20:15:01 +00:00
|
|
|
If your site has more than 30 000 pages, it will automatically split
|
2019-11-26 19:30:30 +00:00
|
|
|
the links into multiple sitemaps, as recommended by [Google](https://support.google.com/webmasters/answer/183668?hl=en):
|
2017-10-01 03:51:43 +00:00
|
|
|
|
2019-03-14 20:15:01 +00:00
|
|
|
> All formats limit a single sitemap to 50MB (uncompressed) and 50,000 URLs.
|
|
|
|
> If you have a larger file or more URLs, you will have to break your list into multiple sitemaps.
|
2019-11-26 19:30:30 +00:00
|
|
|
> You can optionally create a sitemap index file (a file that points to a list of sitemaps) and submit
|
|
|
|
> that single index file to Google.
|
2017-10-01 03:51:43 +00:00
|
|
|
|
2019-03-14 20:15:01 +00:00
|
|
|
In such a case, Zola will use a template called `split_sitemap_index.xml` to render the index sitemap.
|
2017-10-01 03:51:43 +00:00
|
|
|
|
2019-03-14 20:15:01 +00:00
|
|
|
|
|
|
|
The `sitemap.xml` template gets a single variable:
|
|
|
|
|
|
|
|
- `entries`: all pages of the site, as a list of `SitemapEntry`
|
|
|
|
|
|
|
|
A `SitemapEntry` has the following fields:
|
2017-10-01 03:51:43 +00:00
|
|
|
|
|
|
|
```ts
|
|
|
|
permalink: String;
|
2019-10-07 14:39:33 +00:00
|
|
|
updated: String?;
|
2019-03-19 19:42:16 +00:00
|
|
|
extra: Hashmap<String, Any>?;
|
2017-10-01 03:51:43 +00:00
|
|
|
```
|
2018-03-17 13:34:01 +00:00
|
|
|
|
2019-03-14 20:15:01 +00:00
|
|
|
The `split_sitemap_index.xml` also gets a single variable:
|
|
|
|
|
|
|
|
- `sitemaps`: a list of permalinks to the sitemaps
|