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

A paginator’s base_url ends with double slash when paginate_path is empty. #866

Closed
Zegnat opened this issue Nov 30, 2019 · 5 comments
Closed
Labels
done in pr Already done in a PR

Comments

@Zegnat
Copy link

Zegnat commented Nov 30, 2019

Bug Report

I was playing around with getting a simple content listing going, for this I did not want pagination to create a sub-directory. So having a number of pages in /content/ I also created the following _index.md there:

+++
sort_by = "date"
paginate_by = 2 # For testing only
paginate_path = ""
+++

This results in paginator.base_url being http://127.0.0.1:1111// when running zola serve. I would expect just http://127.0.0.1:1111/.

Environment

Zola version: 0.9.0

@Keats
Copy link
Collaborator

Keats commented Dec 1, 2019

Hmm empty path should be an error anyway.

@Zegnat
Copy link
Author

Zegnat commented Dec 1, 2019

Hmm empty path should be an error anyway.

I am pretty happy that it doesn’t throw an error 😉 Currently this lets me do website.local as my homepage and then website.local/2/ for the continuation of said homepage. So to me it seems like a feature more than a bug.

Zola has no problem generating the the files exactly where I would expect them, so other than the double slash at the end I do not see a problem with supporting this use-case.

Keats added a commit that referenced this issue Dec 1, 2019
@Keats
Copy link
Collaborator

Keats commented Dec 1, 2019

That's fixed in next!

@Keats Keats added the done in pr Already done in a PR label Dec 1, 2019
@Zegnat
Copy link
Author

Zegnat commented Dec 1, 2019

Not currently on a machine where I can build Zola from source, but judging from the commit you kept support for the empty path and are now explicitly testing for the behaviour I am using. Many thanks for that!

@Keats
Copy link
Collaborator

Keats commented Dec 1, 2019

Yep, your usecase is a very valid one I didn't think ok.

@Keats Keats closed this as completed in 73ea4b3 Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants