<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    {# =========================
       HOME
    ========================= #}
    <url>
        <loc>{{ public_url('home.index') }}</loc>
        <priority>1.0</priority>
        <changefreq>weekly</changefreq>
    </url>

    {# =========================
       PÔLES
    ========================= #}
    {% for pole in poles %}
        <url>
            <loc>{{ public_url('app_pole_slug_show', {'slug': pole.slug}) }}</loc>
            <priority>0.9</priority>
            <changefreq>weekly</changefreq>
        </url>
    {% endfor %}

    {# =========================
       OFFRES PUBLIÉES ET CONSULTABLES
    ========================= #}
    {% for offre in offres %}
	    {% if offre.slug %}
	        <url>
	            <loc>{{ public_url('app_offre_show', {'slug': offre.slug}) }}</loc>
	            <priority>0.85</priority>
	            <changefreq>monthly</changefreq>
	        </url>
	    {% endif %}
	{% endfor %}

    {# =========================
       PAGES LISTE (projets, ressources, contact, etc.)
    ========================= #}
    {% for page in pages %}
        <url>
            <loc>{{ public_url(page.route) }}</loc>
            <priority>{{ page.priority }}</priority>
        </url>
    {% endfor %}

    {# Pages éditoriales publiées ; les slugs sont uniques dans l'entité Page. #}
    {% for page in editorialPages %}
        <url>
            <loc>{{ public_url('app_page_show', {'slug': page.slug}) }}</loc>
            <priority>0.5</priority>
        </url>
    {% endfor %}

    {# =========================
       PROJETS
    ========================= #}
    {% for projet in projets %}
        <url>
            <loc>{{ public_url('app_projet_show', {'slug': projet.slug}) }}</loc>
            <priority>0.5</priority>
            <changefreq>monthly</changefreq>
        </url>
    {% endfor %}

    {# =========================
       RESSOURCES
    ========================= #}
    {% for ressource in ressources %}
	    {% if ressource.slug %}
	        <url>
	            <loc>{{ public_url('app_ressource_show', {'slug': ressource.slug}) }}</loc>
	            <priority>0.5</priority>
	            <changefreq>monthly</changefreq>
	        </url>
	    {% endif %}
	{% endfor %}

</urlset>
