File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# MIT License
55layout: page
66title: "404: Page not found"
7-
87permalink: /404.html
98
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/
1716
1817dynamic_title: true
1918---
Original file line number Diff line number Diff line change @@ -160,12 +160,16 @@ exclude:
160160 - tools
161161
162162sitemap_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 11---
22layout: compress
3+ #
34# The Sitemap template
45# © 2017-2019 Cotes Chung
56# MIT License
@@ -41,7 +42,30 @@ layout: compress
4142
4243{% for page in site.pages %}
4344
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 %}
4569 {% continue %}
4670 {% endif %}
4771
You can’t perform that action at this time.
0 commit comments