templates/sitemap/sitemap.xml.twig line 1

Open in your IDE?
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  3.         xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  4.     {% for url in urls %}
  5.     <url>
  6.         {# check if hostname is not already in url #}
  7.         <loc>{% if url.loc|replace({hostname:''}) == url.loc %}{{ scheme }}://{{hostname}}{{url.loc}}{% else %}{{url.loc}}{% endif %}</loc>
  8.         {% if url.lastmod is defined %}
  9.             <lastmod>{{ url.lastmod }}</lastmod>
  10.         {% endif %}
  11.         {% if url.changefreq is defined %}
  12.             <changefreq>{{ url.changefreq }}</changefreq>
  13.         {% endif %}
  14.         {% if url.priority is defined %}
  15.             <priority>{{ url.priority }}</priority>
  16.         {% endif %}
  17.     </url>
  18.     {% endfor %}
  19. </urlset>