-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsitemap.xml
54 lines (53 loc) · 1.84 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
49
50
51
52
53
54
---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% assign prepend_url = "https://" %}
{% if site.url contains "https://" or site.url contains "http://" %}
{% assign prepend_url = "" %}
{% endif %}
{% for p in site.pages %}
{% if p.url == page.url %}
{% continue %}
{% endif %}
{% assign include_in_sitemap = p.sitemap %}
{% if p.sitemap == nil or p.sitemap == true %}
{% if p.url contains '/tag/' %}
{% continue %}
{% endif %}
{% assign page_ext = p.url | split: '.' | last %}
{% if site.sitemap.banned contains page_ext %}
{% continue %}
{% endif %}
{% assign is_page_without_extension = page_ext | endswith: '/' %}
{% if site.sitemap.allowed contains page_ext or is_page_without_extension %}
{% assign full_page_url = p.url | prepend: site.url | replace: '/index.html', '' %}
<url>
<loc>{{prepend_url}}{{ site.url }}{{ p.url | replace: '/index.html', '/'}}</loc>
{% if p.last_modified_at %}
<lastmod>{{ p.last_modified_at | date_to_xmlschema }}</lastmod>
{% endif %}
{% if full_page_url == site.url %}
<priority>1.0</priority>
{% elsif p.priority == nil %}
<priority>0.9</priority>
{% else %}
<priority>{{p.priority}}</priority>
{% endif %}
</url>
{% endif %}
{% endif %}
{% endfor %}
{% for post in site.posts %}
{% if post.sitemap == nil or p.sitemap == true %}
<url>
<loc>{{prepend_url}}{{ site.url }}{{ post.url | replace: 'index.html', ''}}</loc>
{% if p.last_modified_at %}
<lastmod>{{ post.last_modified_at | date_to_xmlschema }}</lastmod>
{% endif %}
<priority>1.0</priority>
</url>
{% endif %}
{% endfor %}
</urlset>