kjvarga / sitemap_generator

SitemapGenerator is a framework-agnostic XML Sitemap generator written in Ruby with automatic Rails integration. It supports Video, News, Image, Mobile, PageMap and Alternate Links sitemap extensions and includes Rake tasks for managing your sitemaps, as well as many other great features.
MIT License
2.44k stars 277 forks source link

Is it possible to add additional metadata fields to the xml #412

Closed a85sharm closed 2 years ago

a85sharm commented 2 years ago

I have been using this gem for some time now, and just wanted to clarify that it isnt possible to add additional metadata to the sitemaps when using this gem right? I am implementing a new search and was hoping to just add in a few fields to my sitemap service but it seems like it isnt supported by this gem. Below is an example of what I am looking to do. https://docs.coveo.com/en/2656/index-content/index-xml-sitemap-metadata

kjvarga commented 2 years ago

@a85sharm unfortunately it doesn't support it out of the box, but it's easy to add in a fork of the repo because it's just a couple of changes needed. I could show you an example of that if you'd like. Unfortunately you wouldn't get future updates to the gem, but not a lot is changing these days, and I think the parts that would be modified the changes would merge without conflicts. But depends on your skill level

a85sharm commented 2 years ago

Hey @kjvarga thanks for the response, i had assumed as much, it would just be changes in the sitemap_url.rb right? and then just updating the gem version number?

kjvarga commented 2 years ago

No need to mess with the version number, since I don't think this will make it into the mainline. Unless the solution were abstracted to make it easy to support any sitemap extension.

Here's the changes required and an example of the input https://github.com/kjvarga/sitemap_generator/pull/413. You can adapt the solution for whatever your particular needs are.

a85sharm commented 2 years ago

Hey this is working perfectly! I really appreciate the responses and the time you took to build me an example!

kjvarga commented 2 years ago

Awesome! You’re welcome. You caught me at a good time.