diff --git a/sitemap/test.xml b/sitemap/test.xml index c3fe8ab290..b0949b8c85 100644 --- a/sitemap/test.xml +++ b/sitemap/test.xml @@ -4,63 +4,38 @@ sitemap: exclude: 'yes' --- - - - {% for page in site.pages %} - {% unless page.sitemap.exclude == "yes" or page.name == "feed.xml" %} - - - {{ site.liveUrl }}{{ page.url | remove: "index.html" }} - - {% if page.sitemap.lastmod %} - {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif page.date %} - {{ page.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if page.sitemap.changefreq %} - {{ page.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if page.sitemap.priority %} - {{ page.sitemap.priority }} - {% else %} - 0.3 - {% endif %} - - {% endunless %} - {% endfor %} + {% for collection in site.collections %} - {% for post in collection.docs %} - {% unless post.published == false or post.sitemap.exclude == "yes" or page.name == "feed.xml" %} - - {{ site.liveUrl }}{{ post.url }} - {% if post.sitemap.lastmod %} - {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif post.date %} - {{ post.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if post.sitemap.changefreq %} - {{ post.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if post.sitemap.priority %} - {{ post.sitemap.priority }} - {% else %} - 0.5 - {% endif %} - - {% endunless %} - {% endfor %} + {% if collection.label == 'posts' %} + {% for post in collection.docs %} + {% unless post.published == false or post.sitemap.exclude == "yes" %} + + {{ site.liveUrl }}{{ post.url | absolute_url }} + {% if post.sitemap.lastmod %} + {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif post.date %} + {{ post.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if post.sitemap.changefreq %} + {{ post.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if post.sitemap.priority %} + {{ post.sitemap.priority }} + {% else %} + 0.5 + {% endif %} + + {% endunless %} + {% endfor %} + {% endif %} {% endfor %} +