Sitemap.xml: use Liquid template 'unless' instead of 'if-else'.
This commit is contained in:
parent
0da7ac1b7d
commit
620be19a98
@ -10,13 +10,12 @@
|
|||||||
{% assign exclude = ".htaccess sitemap.xml robots.txt" | split: " " %}
|
{% assign exclude = ".htaccess sitemap.xml robots.txt" | split: " " %}
|
||||||
{% for page in site.pages %}
|
{% for page in site.pages %}
|
||||||
{% assign basename = page.url | split: "/" | last %}
|
{% assign basename = page.url | split: "/" | last %}
|
||||||
{% if exclude contains basename %}
|
{% unless exclude contains basename %}
|
||||||
{% else %}
|
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ site.url }}{{ page.url }}</loc>
|
<loc>{{ site.url }}{{ page.url }}</loc>
|
||||||
<lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
|
<lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
|
||||||
</url>
|
</url>
|
||||||
{% endif %}
|
{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
|
Loading…
Reference in New Issue
Block a user