sitemap icon indicating copy to clipboard operation
sitemap copied to clipboard

Can you add support for image sitemap?

Open jasomdotnet opened this issue 3 years ago • 5 comments

Hi,

I like this repo - so far the simpliest (no stupid requirements) with best documentation. Can you add support for image sitemap? Kindly see this:

  • https://developers.google.com/search/docs/advanced/sitemaps/image-sitemaps?hl=en - documentation
  • https://github.com/dwightwatson/sitemap - example class how is information about images added to it

jasomdotnet avatar May 28 '22 18:05 jasomdotnet

https://www.google.com/schemas/sitemap-image/1.1/ https://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd

jasomdotnet avatar May 28 '22 18:05 jasomdotnet

https://developers.google.com/search/blog/2022/05/spring-cleaning-sitemap-extensions?hl=en

jasomdotnet avatar May 28 '22 18:05 jasomdotnet

I'd like to add it but currently have not enough time for it. A pull request is welcome though.

Yes, I see it as pull request too :D

jasomdotnet avatar May 28 '22 22:05 jasomdotnet

Add images to an existing sitemap, or create a separate sitemap just for your images.

In order to support image sitemap you basically add new sub-lines according this scheme:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>http://example.com/sample1.html</loc>
    <image:image>
      <image:loc>http://example.com/image.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>http://example.com/photo.jpg</image:loc>
    </image:image>
  </url>
  <url>
    <loc>http://example.com/sample2.html</loc>
    <image:image>
      <image:loc>http://example.com/picture.jpg</image:loc>
    </image:image>
  </url>
</urlset>

This increases sitemap.xml file-size. So what about "file-limits" in the case of increasing total generating code. This repo counts overall file-size automatically or in potential pull request I need to alter also "file-limits" part?

jasomdotnet avatar May 29 '22 05:05 jasomdotnet

This repo counts overall file-size automatically or in potential pull request I need to alter also "file-limits" part?

It should count it well but that should be re-checked.

samdark avatar May 29 '22 15:05 samdark