Skip to content

Commit 1b55285

Browse files
authored
Refine sitemap.xml to exclude more file types
1 parent 39fde93 commit 1b55285

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

sitemap.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ layout: none
1010
<priority>1.0</priority>
1111
</url>
1212
{% for page in site.pages %}
13-
{% if page.url != "/" and page.url != "/sitemap.xml" and not page.url contains ".css" %}
14-
<url>
15-
<loc>{{ site.url }}{{ page.url }}</loc>
16-
<lastmod>{{ page.date | date_to_xmlschema }}</lastmod>
17-
</url>
13+
{% if page.url != "/" and page.url != "/sitemap.xml" %}
14+
{% unless page.url contains ".css" or page.url contains ".js" or page.url contains ".png" or page.url contains ".jpg" %}
15+
<url>
16+
<loc>{{ site.url }}{{ page.url }}</loc>
17+
<lastmod>{{ page.date | default: site.time | date_to_xmlschema }}</lastmod>
18+
</url>
19+
{% endunless %}
1820
{% endif %}
1921
{% endfor %}
2022
{% for article in site.articles %}

0 commit comments

Comments
 (0)