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

use url instead of path #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

use url instead of path #13

wants to merge 3 commits into from

Conversation

matsu911
Copy link

url handles clean url properly.
We should use url instead of path to be work with activate :directory_indexes.

@marnen
Copy link
Owner

marnen commented Dec 20, 2016

Thank you! I'll review this shortly.

@marnen
Copy link
Owner

marnen commented Dec 20, 2016

Could you please explain more clearly why you are making these changes?

@@ -21,7 +21,7 @@ def initialize(app, options_hash = {}, &block)
def breadcrumbs(page, separator: @separator, wrapper: @wrapper)
hierarchy = [page]
hierarchy.unshift hierarchy.first.parent while hierarchy.first.parent
hierarchy.collect {|page| wrap link_to(page.data.title, "/#{page.path}"), wrapper: wrapper }.join(h separator)
hierarchy.collect { |x| wrap link_to(x.data.title, x.url), wrapper: wrapper }.join(h separator)
Copy link
Owner

Choose a reason for hiding this comment

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

Why are you changing the name of the block argument from page to x?

Copy link
Contributor

@vinc vinc Nov 22, 2017

Choose a reason for hiding this comment

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

Probably because page shadows the first page declared in the signature of the method. Let's call it p instead of x maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

To keep using the path instead of switching to the URL I'd do something like URI(page.url).path or URI(x.url).path. If that's alright I'll do a new pull request with an explanation of where the old way fails for me.

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