File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <urlset xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9" >
3+ {%- for file in pages -%}
4+ {% if not file.page.is_link and (file.page.abs_url or file.page.canonical_url) %}
5+ <url >
6+ <loc >{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc >
7+ {#- NOTE: we exclude `lastmod` for pages using a template, as their update time is not correctly detected #}
8+ {%- if not file.page.meta.template and file.page.meta.git_revision_date_localized_raw_iso_datetime %}
9+ <lastmod >{{ (file.page.meta.git_revision_date_localized_raw_iso_datetime + "+00:00") | replace(" ", "T") }}</lastmod >
10+ {%- endif %}
11+ {#- NOTE: Add a lastmod to pages that have date in their meta data, e.g., blog posts. #}
12+ {%- if file.page.meta.template and file.page.meta.date %}
13+ <lastmod >{{ (file.page.meta.date.updated or file.page.meta.date.created) | replace(" ", "T") }}</lastmod >
14+ {%- endif %}
15+ {#- NOTE: You can add a priority to the front matter (meta) for a page. #}
16+ {#- Valid values range from 0.0 to 1.0, if no value is set the default is 0.5. #}
17+ {#- reference: https://www.sitemaps.org/protocol.html #}
18+ {%- if file.page.meta.priority %}
19+ <priority >{{ file.page.meta.priority }}</priority >
20+ {%- endif %}
21+ </url >
22+ {%- endif -%}
23+ {% endfor %}
24+ </urlset >
You can’t perform that action at this time.
0 commit comments