-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsitemap.xml
More file actions
41 lines (41 loc) · 1.46 KB
/
Copy pathsitemap.xml
File metadata and controls
41 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
# Rendered by Jekyll on every build, so a new post or page appears here without
# anyone remembering to regenerate anything.
#
# jekyll-sitemap is not used because it emits no <lastmod> for pages and cannot
# emit <xhtml:link> hreflang alternates. Both come from front matter that
# tools/build.mjs writes into each generated page, and its validation pass
# fails the build if a page that should carry them does not.
#
# A page opts out with `sitemap: false` or `noindex: true`.
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{%- for page in site.pages -%}
{%- unless page.sitemap == false or page.noindex or page.url contains '.xml' or page.url contains '.txt' or page.url contains '.json' %}
<url>
<loc>{{ page.url | replace: 'index.html', '' | absolute_url }}</loc>
{%- if page.lastmod %}
<lastmod>{{ page.lastmod }}</lastmod>
{%- endif %}
{%- for alt in page.alternates %}
<xhtml:link rel="alternate" hreflang="{{ alt.hreflang }}" href="{{ alt.href }}"/>
{%- endfor %}
</url>
{%- endunless -%}
{%- endfor -%}
{%- for post in site.posts %}
<url>
<loc>{{ post.url | absolute_url }}</loc>
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
</url>
{%- endfor -%}
{%- for file in site.static_files %}
{%- if file.extname == '.html' %}
<url>
<loc>{{ file.path | absolute_url }}</loc>
</url>
{%- endif -%}
{%- endfor %}
</urlset>