Skip to content

Add latest link to site #72

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

Merged
merged 2 commits into from Jul 24, 2015
Merged

Add latest link to site #72

merged 2 commits into from Jul 24, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jul 23, 2015

@myronmarston Now you can have /documentation/latest/rspec-expectations (http://localhost:4567/documentation/latest/rspec-expectations/). Referencing rspec/rspec-expectations#823 here. I used middleman's proxy-method for this. This requires a valid entry in the sitemap as destination. This only works for index.html. Ok?

string.gsub(JS_ESCAPE_PATTERN) { |match| '\\' + JS_ESCAPES[match] }
end
RSpecInfo::Helpers.rspec_documentation_latest(source_dir).each do |gem_name, version|
proxy "/documentation/latest/#{gem_name}/", "/documentation/#{version}/#{gem_name}/index.html"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing around with this locally, it looks like this works for the root README page for each gem but not for any pages under that. For rspec/rspec-expectations#823, we really just want http://rspec.info/documentation/latest/rspec-expectations/RSpec/Matchers/MatcherProtocol.html to proxy or redirect to http://rspec.info/documentation/3.3/rspec-expectations/RSpec/Matchers/MatcherProtocol.html but that's not working right now.

Can you think of a way to make this work for all the doc pages?

Also, redirects would be better than serving the same content at a second URL. Of course, with a static site generator you can't choose HTTP status codes to respond with to do a proper redirect but we could use a meta refresh tag. Thoughts?

/cc @JonRowe

@ghost
Copy link
Author

ghost commented Jul 23, 2015

What about this one?

@ghost
Copy link
Author

ghost commented Jul 23, 2015

Can you think of a way to make this work for all the doc pages?

I tried a few ones and it worked for me.

Also, redirects would be better than serving the same content at a second URL.

Fixed.

@JonRowe
Copy link
Member

JonRowe commented Jul 23, 2015

Do you think your could split the commits for the refactoring vs the additional redirect? bit hard to understand in one chunk

@ghost
Copy link
Author

ghost commented Jul 23, 2015

Better?

@ghost
Copy link
Author

ghost commented Jul 23, 2015

@@ -0,0 +1,5 @@
- content_for(:senarios) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/senarios/scenarios/

...although, why call it that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. C&P error. Sorry. Took that one from their documentation. Should have been - content_for(:head) do. Was a bit in a hurry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries :). Mind fixing it? Seems necessary for it to work properly. I'll be happy to merge once that's fixed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jup... In the next 30 mins I think... I just need to finish my breakfast ;-).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must be in a different time zone. It's 11 PM here and I'll be going to bed shortly :).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's almost 5pm on friday here ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Fixed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, Germany: http://www.timeanddate.com/worldclock/germany/berlin 😄 @JonRowe Oh, then weekend is near.

myronmarston added a commit that referenced this pull request Jul 24, 2015
@myronmarston myronmarston merged commit c370bcd into rspec:source Jul 24, 2015
@ghost
Copy link
Author

ghost commented Jul 24, 2015

Thanks.

@myronmarston
Copy link
Member

@ghost
Copy link
Author

ghost commented Jul 24, 2015

Great.

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

Successfully merging this pull request may close these issues.

3 participants