Comments (4)
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.
Put that below your SitemapGenerator::Sitemap.sitemaps_path = "sitemap"
line in the config.
from sitemap_generator.
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.
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)
- Ping failed for Bing: #<OpenURI::HTTPError: 410 Gone> HOT 2
- Feature Request: Remove unwanted options HOT 6
- Is it possible to override the default link options? HOT 3
- How to remove default priority, lastmod and changefreq from all urls HOT 1
- GoogleStorageAdapter - Can't create sitemap on buckets with uniform bucket-level access enabled HOT 3
- Allow disable acl for S3 bucket HOT 1
- Rails on Heroku with S3 sitemap hosting - google didn't like it HOT 2
- 【Worked】Ping failed for Bing: #<OpenURI::HTTPError: 410 Gone> HOT 4
- Is it possible to add additional metadata fields to the xml HOT 5
- Feature request : Make `default_host` optional / Allow full URL instead of path HOT 2
- Entity escaping in XML output
- google search console couldn't fetch sitemap but index is ok HOT 7
- Google search correct ping url HOT 2
- Readme install instructions fail HOT 1
- [BUG] Mobile sitemap link in Readme.md is giving 404
- TimeZone is ignored
- sitemap.xml.gz file not found on server
- Testing with frozen time does not work
- should sitemap show up automatically in google search console? HOT 2
- Should we drop default `lastmod` of `Time.now` as Google says "it needs to consistently match reality"? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sitemap_generator.