generated from woodcox/primitive-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsitemap.xml
48 lines (48 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
40
41
42
43
44
45
46
47
48
---
layout: null
---
<?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">
{%- for primary in site.data.nav.primary %}
<url>
<loc>{{ site.url }}{{ primary.href | relative_url }}</loc>
{%- if primary.lastmod == null %}
<lastmod>{{ "now" | date: "%Y-%m-%d %H:%M" | date_to_xmlschema }}</lastmod>
{%- else %}
<lastmod>{{ primary.lastmod | date_to_xmlschema }}</lastmod>
{%- endif %}
<changefreq>monthly</changefreq>
{%- if primary.text == "Home" %}
<priority>1.0</priority>
{%- else %}
<priority>0.7</priority>
{%- endif %}
</url>
{%- endfor %}
{%- for doc in site.documents %}
{%- if doc.sitemap == true %}
<url>
<loc>{{ site.url }}{{ doc.url | relative_url }}</loc>
{%- if doc.lastmod == null %}
<lastmod>{{ "now" | date: "%Y-%m-%d %H:%M" | date_to_xmlschema }}</lastmod>
{%- else %}
<lastmod>{{ doc.lastmod | date_to_xmlschema }}</lastmod>
{%- endif %}
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
{%- endif %}
{%- endfor %}
{%- for page in site.pages %}
{%- if page.sitemap != null and page.sitemap != empty %}
<url>
<loc>{{ site.url }}{{ page.url | relative_url }}</loc>
<lastmod>{{ page.sitemap.lastmod | date_to_xmlschema }}</lastmod>
<changefreq>{{ page.sitemap.changefreq }}</changefreq>
<priority>{{ page.sitemap.priority }}</priority>
</url>
{%- endif %}
{%- endfor %}
</urlset>