Sitemap to include page assets support images and videos

Google extended the sitemap schema to support images and videos. if SitemapEntry were to include page.assets then supporting these two google schema enhancements would be possible using a custom sitemap.xml template.

Google schemas


Given zola page already has a collection of assets. Would be possible to include assets along with the variables currently included with SitemapEntry we could then do something like this:

{% for sitemap_entry in entries %}

       {% if sitemap_entry.assets %}
       {% for file in sitemap_entry.assets %}
       {% if file is matching("(jpg/png/gif)") %}

          <image:geo_location>Some Location</image:geo_location>
      {% endif %}

{% endfor %}

A similar implementation for videos.

Would that break other sitemap parsers? I feel like this is something that people can update themselves and not be built-in as it likely requires some additional caption etc

No, supporting these extensions will not break parsing. Over on they show how to extend the base XML schema with customisation.

Google’s extension for images and video is compliant with the sitemap scheme.

Yoast and all the wordpress SEO plugins that generate sitemaps conform and support the extentions. So no it will not break any parsers that support schemas.

Google is currently running at 70% of all internet searches, supporting their extensions is desirable.

The only thing missing to do this is a list of assets associated with a page.

I am confused how this is something people can do? There doesn’t seem to be a Zola API to get a complete list of sections, pages or assets. Am I missing something?

Adding assets to SitemapEntry would be very useful in this instance. Or providing a way to loop through all sections/pages/assets would allow developers to roll their own sitemap from scratch.