Skip to content

Commit fcec9da

Browse files
authored
Merge pull request #177 from aceat64/docs-sitemap
docs: sitemap.xml typo, added <priority> to example
2 parents c6f422f + 6061e6d commit fcec9da

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/howto/override-a-theme.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ We can use the [mkdocs template variables](https://www.mkdocs.org/dev-guide/them
145145
{% endblock %}
146146
```
147147

148-
## Example: Populate `sitemap.xlm`
148+
## Example: Populate `sitemap.xml`
149149

150-
Having a correct lastmod in your `sitemap.xlm` is important for SEO, as it indicates to Search engines when to re-index pages, see [this blog from Bing](https://blogs.bing.com/webmaster/february-2023/The-Importance-of-Setting-the-lastmod-Tag-in-Your-Sitemap).
150+
Having a correct lastmod in your `sitemap.xml` is important for SEO, as it indicates to Search engines when to re-index pages, see [this blog from Bing](https://blogs.bing.com/webmaster/february-2023/The-Importance-of-Setting-the-lastmod-Tag-in-Your-Sitemap).
151151

152152
[`@thesuperzapper`](https://github.com/thesuperzapper) shared this [override](https://squidfunk.github.io/mkdocs-material/customization/?h=overri#extending-the-theme) in [mkdocs-git-revision-date-localized-plugin#120](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/issues/120):
153153

@@ -157,12 +157,18 @@ Having a correct lastmod in your `sitemap.xlm` is important for SEO, as it indic
157157
{%- for file in pages -%}
158158
{% if not file.page.is_link and (file.page.abs_url or file.page.canonical_url) %}
159159
<url>
160-
<loc>{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc>
161-
{#- NOTE: we exclude `lastmod` for pages using a template, as their update time is not correctly detected #}
162-
{%- if not file.page.meta.template and file.page.meta.git_revision_date_localized_raw_iso_datetime %}
163-
<lastmod>{{ (file.page.meta.git_revision_date_localized_raw_iso_datetime + "+00:00") | replace(" ", "T") }}</lastmod>
164-
{%- endif %}
165-
<changefreq>daily</changefreq>
160+
<loc>{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc>
161+
{#- NOTE: we exclude `lastmod` for pages using a template, as their update time is not correctly detected #}
162+
{%- if not file.page.meta.template and file.page.meta.git_revision_date_localized_raw_iso_datetime %}
163+
<lastmod>{{ (file.page.meta.git_revision_date_localized_raw_iso_datetime + "+00:00") | replace(" ", "T") }}</lastmod>
164+
{%- endif %}
165+
<changefreq>daily</changefreq>
166+
{#- NOTE: You can add a priority to the front matter (meta) for a page. #}
167+
{#- Valid values range from 0.0 to 1.0, if no value is set the default is 0.5. #}
168+
{#- reference: https://www.sitemaps.org/protocol.html #}
169+
{%- if file.page.meta.priority %}
170+
<priority>{{ file.page.meta.priority }}</priority>
171+
{%- endif %}
166172
</url>
167173
{%- endif -%}
168174
{% endfor %}

0 commit comments

Comments
 (0)