Google is unhappy with generated sitemap

I just started with zola (0.8.0) and it works fine after a little reading. However, I generated my webpages and want to tell google about all pages by using the generated sitemap. This does not work, as I include the protocol in my base url, which gets https%3A due to urlencode.
Further is google not happy with xmlns, but it is happy with
The namespace I can easily fix with a own sitemap.xml like so:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">
    {% for sitemap_entry in entries %}
            <loc>{{ sitemap_entry.permalink |  urlencode | safe }}</loc>
            {% if %}
                <lastmod>{{ }}</lastmod>
            {% endif %}
    {% endfor %}

I could also remove the urlencode, but imho it is necessary there, it should just ignore the :// between protocol and domain.
However, I have by now no idea how to do that properly.

Yep this is going to be fixed in the next version.

If your links don’t have special characters like &, you can remove the urlencode without any issues.

I have also opened to implement the urlencoding in rust-url (which urlencode uses) directly otherwise I’ll have to implement it manually in Tera.

1 Like

Thank you for fast respone & explanation!

With all of these, I don’t understand why safe is being used at all. And then why do you even need urlencode? I would not expect URL encoding to be necessary in such a position.

The next branch uses XML escape instead