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

Remove trailing slash from html_url if present #64

Merged
merged 3 commits into from
Jun 22, 2016
Merged

Conversation

benbalter
Copy link
Contributor

For consistency, the html_url field of the pages preview API will begin returning URLs with trailing slashes in all cases. Because many sites hardcode things like {{ page.url | prepend: site.github.url }}, we need to maintain backwards compatibility, and have site.github.url continue to not have a trailing slash.

This PR simply strips the trailing slash from the calculated URL or API response, if it's present, so that we never have a trailing slash. Ever.

@benbalter benbalter self-assigned this Jun 22, 2016
@benbalter
Copy link
Contributor Author

@parkr how does this look to you? Looks like tests are failing because 2.0.1 was released, but not in the latest version of the Pages gem.

I'm going to suggest we merge this here, cut 2.0.2, and bump the pages gem once with both, since 2.0.1 contains no in-production changes.

@parkr
Copy link
Member

parkr commented Jun 22, 2016

LGTM. I need to figure out a better way to test against the github-pages gem. Maybe just forcing the version.rb file to contain whatever github-pages depends on...

@benbalter benbalter merged commit 30d572d into master Jun 22, 2016
@benbalter benbalter deleted the untrailingslashit branch June 22, 2016 19:08
benbalter added a commit that referenced this pull request Jun 22, 2016
@jekyll jekyll locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants