Giter Site home page Giter Site logo

News Sitemap? about sitemap_generator HOT 6 CLOSED

kjvarga avatar kjvarga commented on August 15, 2024
News Sitemap?

from sitemap_generator.

Comments (6)

kjvarga avatar kjvarga commented on August 15, 2024

I don't have any immediate plans to add support, but I'm all for it!

This looks very easy to implement. There should just be two spots required to support it:

builder/sitemap_file.rb#build_xml - need a similar block to the one we use for images
link.rb#prepare_images - need a similar function for news and use it in generate()
sitemap_generator.rb#MAX_SITEMAP_NEWS - add a constant for the max news per url (should be 1000)

Let me know how you go...

from sitemap_generator.

rodrigoflores avatar rodrigoflores commented on August 15, 2024

I've created a fork and implemented this feature as you suggested. Please take a look:

https://github.com/rodrigoflores/sitemap_generator

I will write some tests before doing a pull request, but I think it is ok to get some feedback from you :)

from sitemap_generator.

kjvarga avatar kjvarga commented on August 15, 2024

Hi @rodrigoflores, thanks for working on this! News sitemaps will be great to include. I've taken a look at your code and it looks good.

The only thing missing is that we don't keep track of how many news URLs have been added to the sitemap. We should show a warning or error if there are more than the limit (1000). I think the best place is in SitemapFIle#add when we add the link to ask the link if it's a news link e.g. link.news? and increment a counter if so. See how you go...it's not a crucial part.

I've found the XSD schema here http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd and the description of the elements here http://www.google.com/support/news_pub/bin/answer.py?answer=74288.

Thanks for adding tests. You can take a look at the video sitemap spec file for some idea of how to use the validator (though it's not the best code).

Let me know if you need any help.

Cheers,

from sitemap_generator.

rodrigoflores avatar rodrigoflores commented on August 15, 2024

I've added the things you asked and some tests. I will write some tests to the limit and do a pull request. OK?

https://github.com/rodrigoflores/sitemap_generator/

from sitemap_generator.

kjvarga avatar kjvarga commented on August 15, 2024

Ok I've released v2.1.0. Thanks again!

from sitemap_generator.

georgeguimaraes avatar georgeguimaraes commented on August 15, 2024

tks kjvarga and rodrigoflores! =)

from sitemap_generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.