This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitemap.xml
39 lines (39 loc) · 1.63 KB
/
sitemap.xml
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
---
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% assign pages = site.pages | sort: "url" %}
{% for page in pages %}
{% unless page.url contains '.xml' or page.url contains '.txt' or page.url contains '.css' %}
<url>
<loc>{{ page.url | absolute_url }}</loc>
{% if page.last_modified %}
{% assign last_modified = page.last_modified %}
{% elsif page.date %}
{% assign last_modified = page.date %}
{% else %}
{% assign last_modified = site.date %}
{% endif %}
{% if last_modified %}
<lastmod>{{ last_modified | date_to_xmlschema }}</lastmod>
{% endif %}
</url>
{% endunless %}
{% endfor %}
{% assign posts = site.posts %}
{% for post in posts %}
<url>
<loc>{{ post.url | absolute_url }}</loc>
{% if post.last_modified %}
{% assign last_modified = post.last_modified %}
{% elsif post.date %}
{% assign last_modified = post.date %}
{% else %}
{% assign last_modified = site.date %}
{% endif %}
{% if last_modified %}
<lastmod>{{ last_modified | date_to_xmlschema }}</lastmod>
{% endif %}
</url>
{% endfor %}
</urlset>