mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Fix sitemap
This commit is contained in:
19
sitemap.xml
19
sitemap.xml
@@ -6,23 +6,30 @@ search: exclude
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
{% for page in site.pages %}
|
{% for page in site.pages %}
|
||||||
{% if page.url != "/assets/css/style.css" %}
|
{% assign number = page.url | remove: ".html" | remove: "/" %}
|
||||||
{% if page.url != "/sitemap.xml" %}
|
{% assign characters = number | split: "" %}
|
||||||
|
{% assign is_number = true %}
|
||||||
|
{% for char in characters %}
|
||||||
|
{% if char != "0" and char != "1" and char != "2" and char != "3" and char != "4" and char != "5" and char != "6" and char != "7" and char != "8" and char != "9" %}
|
||||||
|
{% assign is_number = false %}
|
||||||
|
{% break %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% if is_number and number != "404" %}
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ page.url }}</loc>
|
<loc>/{{ number }}</loc>
|
||||||
<lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
|
<lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
|
||||||
<changefreq>hourly</changefreq>
|
<changefreq>always</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ post.url }}</loc>
|
<loc>{{ post.url }}</loc>
|
||||||
<lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
|
<lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
|
||||||
<changefreq>hourly</changefreq>
|
<changefreq>always</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user