Skip to content

Duplicate slashes in source file URLs#690

Closed
MarinBernard wants to merge 2 commits intosquidfunk:masterfrom
MarinBernard:master
Closed

Duplicate slashes in source file URLs#690
MarinBernard wants to merge 2 commits intosquidfunk:masterfrom
MarinBernard:master

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.

3 participants