Skip to content

Commit 07a297b

Browse files
author
Oleh Prypin
committed
Skip entries with missing abs_url from sitemap
1 parent 56b235a commit 07a297b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mkdocs/templates/sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
{%- for file in pages -%}
4-
{% if not file.page.is_link %}
4+
{% if not file.page.is_link and (file.page.abs_url or file.page.canonical_url) %}
55
<url>
66
<loc>{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc>
77
{% if file.page.update_date %}<lastmod>{{file.page.update_date}}</lastmod>{% endif %}

0 commit comments

Comments
 (0)