sitemap.xml.twig 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="{{ uri.rootUrl }}/user/plugins/sitemap/sitemap.xsl"?>
  3. <urlset xmlns="{{ config.plugins.sitemap.urlset }}"
  4. xmlns:xhtml="http://www.w3.org/1999/xhtml"
  5. xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  6. {% for entry in sitemap %}
  7. <url>
  8. <loc>{{ entry.location|e }}</loc>
  9. {% for hreflang in entry.hreflangs %}
  10. <xhtml:link rel="alternate" hreflang="{{ hreflang.hreflang }}" href="{{ hreflang.href }}" />
  11. {% endfor %}
  12. {% if entry.lastmod %}
  13. <lastmod>{{ entry.lastmod }}</lastmod>
  14. {% endif %}
  15. {% if entry.changefreq %}
  16. <changefreq>{{ entry.changefreq }}</changefreq>
  17. {% endif %}
  18. {% if entry.priority %}
  19. <priority>{{ entry.priority|number_format(1) }}</priority>
  20. {% endif %}
  21. {% for image in entry.images %}
  22. <image:image>
  23. {% if image.loc %}
  24. <image:loc>{{ url(image.loc, true) }}</image:loc>
  25. {% endif %}
  26. {% if image.caption %}
  27. <image:caption>{{ image.caption }}</image:caption>
  28. {% endif %}
  29. {% if image.geoloc %}
  30. <image:geo_location>{{ image.geoloc }}</image:geo_location>
  31. {% endif %}
  32. {% if image.title %}
  33. <image:title>{{ image.title }}</image:title>
  34. {% endif %}
  35. {% if image.license %}
  36. <image:license>{{ image.license }}</image:license>
  37. {% endif %}
  38. </image:image>
  39. {% endfor %}
  40. </url>
  41. {% endfor %}
  42. </urlset>