Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemaps generating unexpected sitemaps path for AwsSdkAdapter #279

Closed
jfyzhao opened this issue Jun 2, 2017 · 4 comments
Closed

Sitemaps generating unexpected sitemaps path for AwsSdkAdapter #279

jfyzhao opened this issue Jun 2, 2017 · 4 comments

Comments

@jfyzhao
Copy link

jfyzhao commented Jun 2, 2017

I'm using the following settings with the AwsSdk Adapter for creating my stiemaps:
SitemapGenerator::Sitemap.default_host = "https://www.mysite.com"
SitemapGenerator::Sitemap.create_index = true
SitemapGenerator::Sitemap.sitemaps_host = "https://s3-us-west-2.amazonaws.com/mysite-assets/"
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/"
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new('mysite-assets')

However, this is generating the sitemaps in https://s3-us-west-2.amazonaws.com/mysite-assets/sitemaps/sitemaps/ so that there is an extra sitemaps/ subdirectory created. I can remove the SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/" line, but that causes the search engines to incorrectly ping for the sitemaps in https://s3-us-west-2.amazonaws.com/mysite-assets/ instead of https://s3-us-west-2.amazonaws.com/mysite-assets/sitemaps/

@kjvarga
Copy link
Owner

kjvarga commented Jun 3, 2017

You're right, there's a bug in the AwsSdkAdapter code here https://github.com/kjvarga/sitemap_generator/blob/master/lib/sitemap_generator/adapters/aws_sdk_adapter.rb#L25

Can you try creating your adapter like so:
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new('mysite-assets', :path => '')

That should avoid the issue until I can fix it. I didn't actually write that code. But I shouldn't have let a hard-coded path through the cracks :/

@jfyzhao
Copy link
Author

jfyzhao commented Jun 3, 2017

Yup that fixed it! No worries, thanks for the suggestion.

@bwoodmansee
Copy link

bwoodmansee commented Oct 2, 2017

👍 -- thanks for posting this

@kjvarga
Copy link
Owner

kjvarga commented Oct 11, 2017

This is fixed in v6.0.0 of the gem, you can remove this workaround.

@kjvarga kjvarga closed this as completed Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants