Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Syfony Simple Sitemap
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">
{% for url in urls %}
<url>{# check if hostname is not alreay in url#}
<loc>http://{%if url.loc|replace({hostname:''}) == url.loc%}{{hostname}}{{url.loc}}{%else%}{{url.loc}}{%endif%}</loc>
{% if url.lastmod is defined %}
{% endif %}
{% if url.changefreq is defined %}
{% endif %}
{% if url.priority is defined %}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.