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
Trouble with Redirects and Sitemap #1166
Comments
Thanks for the test case. I'll look into it. Seems weird that the proxy code is being called on it. Mind trying Ruby 2.0 really quick to see if it's a 2.1 issue? |
I'm getting this same issue. Anyone make any progress on it? |
Commenting out line #66 in proxies.rb fixed it on my end. There may be negative side effects. |
My guess is that |
Note to self, I think fixing #1217 will fix this. |
I also have this issue! Any progress? |
I managed to do redirect with symlinks. (Since neither this or Say you have a file in You would do the following:
I hope this comes useful to anyone. :) Regards. Costea |
Pretty sure this got fixed along the way, but I need to run some tests. |
@tdreyno I was using the last version of middleman when testing this, didn't work at all. Will the symlinks hack make things worse? |
Well, symlinks won't redirect. They'll probably duplicate the output files. Does this only happen when looking at the sitemap? |
I haven't tried it the other way than just accessing the redirected page, which yields up an empty page. |
@nemesis Can you paste the source of the empty page? I just pushed a fix to help that error in the sitemap preview, but that wouldn't do anything to the actual functionality in your site. |
I was having this same issue, though it was when I was generating an XML sitemap (and was therefore preventing I was able to solve that issue by excluding the redirect resources when printing them in the sitemap with the following method:
It's a bit of a hack, but gets the job done. |
would |
Good point @tdreyno, the full class name with namespaces is
|
Did this ever get fixed? I just ran into this today using Middleman 3.2.1 on Ruby 2.1.2. Thanks in advance for your time and for Middleman! |
Not sure if this is related or not, but I see redirects served up as plain text, not html, so the redirect doesn't happen on the client. |
@milesmatthias In the Middleman preview server or on your deployed server? |
It got fixed, but maybe not back ported to v3. @calebhailey is your issue the original (in the MM debug view?) or something from later in the thread? |
@tdreyno both. I'm using v3.4.0. |
May not help, but give |
Hi there! I've hit this very same issue while developing our website. I'm trying to mimic our The relevant code in ready do
project_pages = sitemap.resources.select { |resource| resource.destination_path.start_with? 'projects/' }
project_pages.each do |page|
destination_path = page.destination_path
redirect (destination_path.sub "projects/", "work/"), to: destination_path
end
end Like... filter all the As class Middleman::Sitemap::Extensions::Redirects::RedirectResource
def get_source_file
@request_path.source_file
end
end
ready do
project_pages = sitemap.resources.select { |resource| resource.destination_path.start_with? 'projects/' }
project_pages.each do |page|
destination_path = page.destination_path
redirect (destination_path.sub "projects/", "work/"), to: page # <-- page is a Middleman::Sitemap::Resource
end
end If you have a path and want to get it's Hope this helps avoid some headaches! |
I'm doing some issue-gardening 🌿🌷🌾 and came across this issue. @matiasgarciaisaia is this an issue with Middleman? If so, would you be open to making a PR with a fix + test? That would be an awesome thing! 😎 |
So Middleman won't hang while rendering the sitemap in development Fixes middleman#1166
@sandstrom I wanted to test the changes, but really couldn't find how to. I've opened #2006 with the change, at least. |
@matiasgarciaisaia Awesome! ⛵️ I've commented in that issue. |
For anyone that comes by: this issue should be fixed starting in v3.3.7. Read #2006's comments for more info. I'm not sure why @milesmatthias has seen this in v3.4.0 - are you sure about that? I'd totally close the issue, otherwise. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello,
I'm using the redirects feature to maintain paths when my Middleman website changes. Unfortunately, I've been experiencing some issues in the development environment.
I made a test case to illustrate my problem. In
config.rb
, I have a redirect set up like so:The redirect seems to work as expected, but when I browse to the Sitemap web view, I get the following error in the console:
And here's what I see in my browser:
Am I configuring the redirect incorrectly, or is this a bug?
Also, I haven't been able to find any documentation, other than the Cucumber feature, on the redirect feature. Is it fully supported? Can I help with documentation?
Thanks!
The text was updated successfully, but these errors were encountered: