Browse Source

Sitemap.xml: use Liquid template 'unless' instead of 'if-else'.

master
vonavi 5 years ago
parent
commit
620be19a98
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      sitemap.xml

+ 2
- 3
sitemap.xml View File

@@ -10,13 +10,12 @@
{% assign exclude = ".htaccess sitemap.xml robots.txt" | split: " " %}
{% for page in site.pages %}
{% assign basename = page.url | split: "/" | last %}
{% if exclude contains basename %}
{% else %}
{% unless exclude contains basename %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
<lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
</url>
{% endif %}
{% endunless %}
{% endfor %}

{% for post in site.posts %}

Loading…
Cancel
Save