File tree 3 files changed +45
-18
lines changed
3 files changed +45
-18
lines changed Original file line number Diff line number Diff line change 4
4
# MIT License
5
5
layout: page
6
6
title: "404: Page not found"
7
-
8
7
permalink: /404.html
9
8
10
- redirect_from: # Same as site.blocklist
11
- - /norobots/
12
- - /assets/
13
- - /tabs/
14
- - /categories/
15
- - /tags/
16
- - /posts/
9
+ redirect_from: # part of site.sitemap_exclude
10
+ - /norobots/
11
+ - /assets/
12
+ - /tabs/
13
+ - /categories/
14
+ - /tags/
15
+ - /posts/
17
16
18
17
dynamic_title: true
19
18
---
Original file line number Diff line number Diff line change @@ -160,12 +160,16 @@ exclude:
160
160
- tools
161
161
162
162
sitemap_exclude : # Sitemap will exclude the following items.
163
- - /norobots/
164
- - /assets/
165
- - /tabs/
166
- - /categories/
167
- - /tags/
168
- - /posts/
169
- - /404.html
170
- - /redirects.json
171
- - /search.json
163
+ fuzzy :
164
+ - /assets/
165
+ accurate :
166
+ - /norobots/
167
+ - /tabs/
168
+ - /categories/
169
+ - /tags/
170
+ - /posts/
171
+ - 404.html
172
+ - feed.xml
173
+ - sitemap.xml
174
+ - robots.txt
175
+ - redirects.json
Original file line number Diff line number Diff line change 1
1
---
2
2
layout: compress
3
+ #
3
4
# The Sitemap template
4
5
# © 2017-2019 Cotes Chung
5
6
# MIT License
@@ -41,7 +42,30 @@ layout: compress
41
42
42
43
{% for page in site.pages %}
43
44
44
- {% if site.sitemap_exclude contains page.url %}
45
+ {% assign pass = false %}
46
+
47
+ {% for fuzzy in site.sitemap_exclude.fuzzy %}
48
+ {% if page.url contains fuzzy %}
49
+ {% assign pass = true %}
50
+ {% break %}
51
+ {% endif %}
52
+ {% endfor %}
53
+
54
+ {% unless pass %}
55
+ {% for accurate in site.sitemap_exclude.accurate %}
56
+ {% assign len = accurate | size %}
57
+ {% capture beg %}{{ 0 | minus: len }}{% endcapture %}
58
+ {% capture tail %}{{ page.url | slice: beg, len }}{% endcapture %}
59
+
60
+ {% if tail == accurate %}
61
+ {% assign pass = true %}
62
+ {% break %}
63
+ {% endif %}
64
+
65
+ {% endfor %}
66
+ {% endunless %}
67
+
68
+ {% if pass %}
45
69
{% continue %}
46
70
{% endif %}
47
71
You can’t perform that action at this time.
0 commit comments