{% for url in urls %} {% if 'https' in url.loc %} {{ url.loc }} {% elseif url.loc|replace({hostname: ''}) == url.loc %} {{ hostname }}{{ url.loc }} {% else %} {{ url.loc }} {% endif %} {% if url.lastmod is defined %} {{ url.lastmod }} {% endif %} {% endfor %}