-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.xml
More file actions
30 lines (28 loc) · 807 Bytes
/
Copy pathsitemap.xml
File metadata and controls
30 lines (28 loc) · 807 Bytes
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
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% comment %} Loop through all pages {% endcomment %}
{% for page in site.pages %}
{% if page.url != "/404.html" %}
<url>
<loc>{{ site.url }}{{ page.url | replace:'index.html','' }}</loc>
</url>
{% endif %}
{% endfor %}
{% comment %} Loop through all posts {% endcomment %}
{% for post in site.posts %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
</url>
{% endfor %}
{% comment %} Loop through collections if any {% endcomment %}
{% for collection in site.collections %}
{% for item in collection.docs %}
<url>
<loc>{{ site.url }}{{ item.url }}</loc>
</url>
{% endfor %}
{% endfor %}
</urlset>