1
Fork 0

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

master
vonavi 2014-07-03 00:10:15 +03:00
parent 0da7ac1b7d
commit 620be19a98
1 changed files with 2 additions and 3 deletions

View File

@ -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 %}