sitemap.xml 1.1 KB

123456789101112131415161718192021222324252627
  1. ---
  2. ---
  3. <?xml version='1.0' encoding='UTF-8'?>
  4. <urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>
  5. <!-- posts -->
  6. {% for post in site.posts %}
  7. {% include sitemap_entry.html url=post.url change_frequency=post.change_frequency priority=post.priority %}
  8. {% endfor %}
  9. <!-- pages -->
  10. {% for site_page in site.pages %}
  11. {% include sitemap_entry.html url=site_page.url change_frequency=site_page.change_frequency priority=site_page.priority %}
  12. {% comment %}
  13. Add an extra entry for all pages that have "/{latest version}/" in their URI.
  14. The extra entry is the same, with "/{latest version}/" replaced with "/latest/".
  15. This is done because "/latest/" doesn't actually exist as a page; it's an alias
  16. in the .htaccess file.
  17. {% endcomment %}
  18. {% capture latest_docs_version_prefix %}/{{ site.latest_docs_version }}/{% endcapture %}
  19. {% if site_page.url contains latest_docs_version_prefix %}
  20. {% assign latest_url = site_page.url | replace: latest_docs_version_prefix,"/latest/" %}
  21. {% include sitemap_entry.html url=latest_url change_frequency=site_page.change_frequency priority=0.9 %}
  22. {% endif %}
  23. {% endfor %}
  24. </urlset>