Giter Site home page Giter Site logo

Comments (4)

kjvarga avatar kjvarga commented on July 16, 2024

Unfortunately a long time ago when Adam created this gem he made SitemapGenerator::Sitemap and instance of an object. I would rather instantiate an instance like so SitemapGenerator::Sitemap.new(options!!)... so that minor API decision means that at the moment it's not easy to just create a sitemap instance and add links to it...something I want to see soon because there's no reason this gem should just be for Rails :)

Back to your question...the sitemaps_path option isn't actually supported yet, until I can move the API to a more sensible layout. In the meantime you can do this to get around the problem:

sm = SitemapGenerator::Sitemap
sm.sitemaps_path = '/sitemaps'
sm.sitemap.sitemap_path = sm.send(:new_sitemap_path)
sm.sitemap_index.sitemap_path = sm.send(:sitemap_index_path)

from sitemap_generator.

kjvarga avatar kjvarga commented on July 16, 2024

Put that below your SitemapGenerator::Sitemap.sitemaps_path = "sitemap" line in the config.

from sitemap_generator.

kjvarga avatar kjvarga commented on July 16, 2024

It just occurred to me that if update those paths in the SitemapGenerator::Sitemap.sitemaps_path= method then we can support specifying the sitemap path. A nice easy patch!

BTW The sitemap dir must already exist.

from sitemap_generator.

kjvarga avatar kjvarga commented on July 16, 2024

Ok I've released v1.3.1 which takes care of everything for you. Just set your sitemaps path via:

SitemapGenerator::Sitemap.sitemaps_path = '/sitemaps'

And the rest is taken care of for you. The directory will be created if it DNE.

Let me know if you have any problems with it.

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.