# Sitemap to include page assets support images and videos

**URL:** <https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213>\
**Category:** Uncategorized\
**Created:** [September 27, 2019, 3:04pm UTC](https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213 "2019-09-27T15:04:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SgtIria](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sgtiria/32/85_2.png) [@SgtIria](https://zola.discourse.group/u/SgtIria)\
**Post date:** [September 27, 2019, 3:04pm UTC](https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213/1 "2019-09-27T15:04:44Z")

</div>

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**

```auto
 xmlns="http://www.google.com/schemas/sitemap-image/1.1"
 xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"

```

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:

```auto
<urlset
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns="http://www.google.com/schemas/sitemap-image/1.1"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
{% for sitemap_entry in entries %}
    <url>
       <loc>https://example.com/mens-hats</loc>
       <lastmod>2018-10-12</lastmod>

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

       <image:image>
          …
          
          <image:loc>{{sitemap_entry.assets}}</image:loc>
          <image:caption>{{sitemap_entry.extra.caption-if-you-want}}</image:caption>
          <image:geo_location>Some Location</image:geo_location>
          <image:title>{{sitemap_entry.extra.title-if-you-want}}</image:title>
         ....
       </image:image>
      {% endif %}

    </url>
{% endfor %}
</urlset>

```

A similar implementation for videos.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 27, 2019, 5:38pm UTC](https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213/2 "2019-09-27T17:38:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SgtIria](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sgtiria/32/85_2.png) [@SgtIria](https://zola.discourse.group/u/SgtIria)\
**Post date:** [September 28, 2019, 10:37am UTC](https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213/3 "2019-09-28T10:37:48Z")

</div>

No, supporting these extensions will not break parsing. Over on [sitemaps.org](http://sitemaps.org) they show how to extend the base XML schema with customisation.

[https://www.sitemaps.org/protocol.html#extending](https://www.sitemaps.org/protocol.html#extending)

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 [sitemap.org](http://sitemap.org) 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.

---

<div class="post-metadata">

**Author:** ![riotous.disco](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@riotous.disco](https://zola.discourse.group/u/riotous.disco)\
**Post date:** [July 16, 2022, 12:00pm UTC](https://zola.discourse.group/t/sitemap-to-include-page-assets-support-images-and-videos/213/4 "2022-07-16T12:00:05Z")

</div>

> [@keats](#):
>
> I feel like this is something that people can update themselves and not be built-in as it likely requires some additional caption etc

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.
