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

Duplicate slashes in source file URLs #690

Closed
wants to merge 2 commits into from

Conversation

MarinBernard
Copy link

Hi,

There is an issue with source URLs built by the template from source and path page metadata. The generated URLs include double slashes between the repository URL and the rest of the path. I don't know for Github, but Bitbucket is unable to handle such URLs correctly.

The source of the issue is that the config.repo_url variable is normalized by mkdocs to always include a trailing slash. As a consequence, the join() filter adds a trailing slash where it is not needed.

The attached pull request excludes the config.repo_url variable from the join() operation, assuming repo URLs always include a trailing slash thanks to mkdocs normalization.

Thanks,

Marin.

@squidfunk
Copy link
Owner

My version of mkdocs, 0.17.2, does exhibit this behavior. However, I will provide a fix which will account for double slashes.

@squidfunk
Copy link
Owner

Fixed in b3e293e. My version of MkDocs doesn't normalize the name, so I included code to handle both cases.

@squidfunk squidfunk closed this Feb 11, 2018
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.

None yet

3 participants