sitemap.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. layout: none
  3. ---
  4. <?xml version="1.0" encoding="UTF-8"?>
  5. <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  6. {% assign collections = site.collections | where_exp:'collection','collection.output != false' %}
  7. {% for collection in collections %}
  8. {% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %}
  9. {% for doc in docs %}
  10. <url>
  11. <loc>{% if env != 'development' %}{{ site.preview-url }}{% endif %}{{ doc.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc>
  12. {% if doc.last_modified_at or doc.date %}
  13. <lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod>
  14. {% endif %}
  15. </url>
  16. {% endfor %}
  17. {% endfor %}
  18. {% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %}
  19. {% for page in pages %}
  20. <url>
  21. <loc>{% if env != 'development' %}{{ site.preview-url }}{% endif %}{{ page.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc>
  22. <lastmod>{{ page.last_modified_at | default: site.time | date_to_xmlschema }}</lastmod>
  23. </url>
  24. {% endfor %}
  25. {% assign static_files = page.static_files | where_exp:'page','page.sitemap != false' | where_exp:'page','page.name != "404.html"' %}
  26. {% for file in static_files %}
  27. <url>
  28. <loc>{% if env != 'development' %}{{ site.preview-url }}{% endif %}{{ file.path | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
  29. <lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
  30. </url>
  31. {% endfor %}
  32. </urlset>