From 3ec976842cfc3e6b908de1a16f9bd18948007ecc Mon Sep 17 00:00:00 2001 From: codeandmedia Date: Sat, 13 Mar 2021 20:15:21 +0300 Subject: initial commit --- content/templates/sitemap.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 content/templates/sitemap.md (limited to 'content/templates/sitemap.md') diff --git a/content/templates/sitemap.md b/content/templates/sitemap.md new file mode 100644 index 0000000..3c21351 --- /dev/null +++ b/content/templates/sitemap.md @@ -0,0 +1,34 @@ ++++ +title = "Sitemap" +weight = 60 ++++ + +Zola will look for a `sitemap.xml` file in the `templates` directory or +use the built-in one. + +If your site has more than 30 000 pages, it will automatically split +the links into multiple sitemaps, as recommended by [Google](https://support.google.com/webmasters/answer/183668?hl=en): + +> 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. +> 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. + +In such a case, Zola will use a template called `split_sitemap_index.xml` to render the index sitemap. + + +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: + +```ts +permalink: String; +updated: String?; +extra: Hashmap?; +``` + +The `split_sitemap_index.xml` also gets a single variable: + +- `sitemaps`: a list of permalinks to the sitemaps -- cgit v1.2.3