lib/sitemap.xml in jekyll-sitemap-1.0.0 vs lib/sitemap.xml in jekyll-sitemap-1.1.0

- old
+ new

@@ -6,30 +6,31 @@ {% assign collections = site.collections | where_exp:'collection','collection.output != false' %} {% for collection in collections %} {% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %} {% for doc in docs %} <url> - <loc>{{ doc.url | replace:'/index.html','/' | absolute_url }}</loc> + <loc>{{ doc.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc> {% if doc.last_modified_at or doc.date %} <lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod> {% endif %} </url> {% endfor %} {% endfor %} - {% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' %} + {% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %} {% for page in pages %} <url> - <loc>{{ page.url | replace:'/index.html','/' | absolute_url }}</loc> + <loc>{{ page.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc> {% if page.last_modified_at %} <lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod> {% endif %} </url> {% endfor %} - {% for file in page.static_files %} + {% assign static_files = page.static_files | where_exp:'page','page.name != "404.html"' %} + {% for file in static_files %} <url> - <loc>{{ file.path | absolute_url }}</loc> + <loc>{{ file.path | absolute_url | xml_escape }}</loc> <lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod> </url> {% endfor %} </urlset>