-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.xml
More file actions
30 lines (29 loc) · 997 Bytes
/
sitemap.xml
File metadata and controls
30 lines (29 loc) · 997 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
permalink: /sitemap.xml
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
<lastmod>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</lastmod>
</url>
{% endfor %}
{% for page in site.pages %}
{% assign url = page.url | replace: '//', '/' %}
{% assign is_paginated = url | slice: 0, 5 %}
{% unless page.sitemap == false %}
{% unless url == "/sitemap.xml" or url == "/robots.txt" or url == "/feed.xml" or url == "/404.html" %}
{% unless url contains "/tags/" or url contains "/categories/" or is_paginated == "/page" %}
<url>
<loc>{{ site.url }}{{ url }}</loc>
{% if page.last_modified_at %}
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
{% endif %}
</url>
{% endunless %}
{% endunless %}
{% endunless %}
{% endfor %}
</urlset>