-
Notifications
You must be signed in to change notification settings - Fork 74
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
Patch to set S3 redirects? #129
Comments
Absolutely. I haven't been paying any attention to s3_redirect and merging this into s3_sync makes a lot of sense. |
Awesome. In which case, I'll tidy it up into a pull request. 😄 |
@mathie, @matiasgarciaisaia I was using https://github.com/fredjean/middleman-s3_redirect for setting up redirects on my s3 bucket. Can your PR be used as an alternative for this? If yes, is there any documentation/example I can use to setup my project? |
Hi @umerebryx! Do you have this gem installed and configured on your project? Once you add the extension as usual, this PR makes your Middleman's So for example you can add Not sure if that helped, though. |
@matiasgarciaisaia , yes I have middleman-s3_sync configured. I have tried adding redirect method based on your example above but I am getting error
Not sure if I am doing it right. Can you correct my usage of redirect above I am adding this to config.rb. Thanks for your help. |
So your snippet would be something like:
(assuming the rest of the |
Thanks @matiasgarciaisaia , I got the redirects to work locally. But when I use s3_sync to update my s3 bucket these redirects are not synced. I am also calling
Is it possible I have to add above block at a certain place in my config.rb? |
My only suggestion is to run the |
@umerebryx I also ran in to this issue, but realized it is because the most recent release doesn't contain the PR that adds support. I've created #158 to ask for a new version to be released. In the meantime, you can use it if you specify to use the github version: gem 'middleman-s3_sync', github: "fredjean/middleman-s3_sync" |
I've wound up monkey patching Middleman & s3sync to support setting
x-amz-website-redirect-location
on resources configured with theredirect
method inconfig.rb
:https://github.com/wossname/woss.name/blob/master/helpers/s3_redirects.rb. Is that the sort of thing I should be tidying up into a pull request at some point?The text was updated successfully, but these errors were encountered: