-
Notifications
You must be signed in to change notification settings - Fork 1
/
legacy-sitemap.xml
77 lines (65 loc) · 2.03 KB
/
legacy-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
{% if post.changefreq %}
{% assign changefreq = page.changefreq %}
{% else %}
{% assign changefreq = 'monthly' %}
{% endif %}
{% if post.priority and post.priority > 1 and post.priority < 0 %}
{% assign priority = post.priority %}
{% else %}
{% assign priority = '0.5' %}
{% endif %}
{% if page.lastmod %}
{% assign lastmod = page.lastmod %}
{% else %}
{% assign lastmod = post.date %}
{% endif %}
<url>
<changefreq>{{ changefreq }}</changefreq>
<loc>{{ site.base }}{{ post.url | remove_first: '/' | remove: 'index.html' }}</loc>
<lastmod>{{ lastmod | date_to_xmlschema }}</lastmod>
<priority>{{ priority }}</priority>
</url>
{% endfor %}
{% for page in site.pages %}
{% if page.url contains 'page' or page.url contains '404' %}
{% else %}
{% if page.changefreq %}
{% assign changefreq = page.changefreq %}
{% elsif page.url contains 'index.html' %}
{% assign changefreq = 'hourly' %}
{% else %}
{% assign changefreq = 'weekly' %}
{% endif %}
{% if page.sitemap.lastmod %}
{% assign lastmod = page.sitemap.lastmod %}
{% elsif page.lastmod %}
{% assign lastmod = page.lastmod %}
{% elsif page.date %}
{% assign lastmod = page.date %}
{% else %}
{% assign lastmod = site.time %}
{% endif %}
{% if page.priority and page.priority > 1 and page.priority < 0 %}
{% assign priority = page.priority %}
{% elsif page.url == '/index.html' %}
{% assign priority = '1.0' %}
{% elsif page.url contains 'index.html' %}
{% assign priority = '0.7' %}
{% else %}
{% assign priority = '0.3' %}
{% endif %}
<url>
<changefreq>{{ changefreq }}</changefreq>
<lastmod>{{ lastmod | date_to_xmlschema }}</lastmod>
<loc>{{ site.base }}{{ page.url | remove_first: '/' | remove: 'index.html' }}</loc>
<priority>{{ priority }}</priority>
</url>
{% endif %}
{% endfor %}
</urlset>