-
Notifications
You must be signed in to change notification settings - Fork 996
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
Inconsistent current_path #1086
Comments
In theory it should consistently have a leading/trailing |
By the way, as a side note from my personal experience, I'm aware that the documentation clarifies that BTW, not to nitpick, but the same documentation page defines this variable as "the path (full URL without |
OK, one more follow-up to the non-nitpick: currently, the site root's On the other hand, if To summarize, if we follow a simple logic to derive |
I think |
Having thought about it for a while, I now think all the paths should start with a @yanghuidong are you interested in working on path? |
I'm interested of course :) But I'm also new to Zola, and never had real experience collaborating via git, so it would take me some unknown amount of time to actually start getting to know the code, and even learn the GitHub basics, which means I will likely need some guidance just to get going. So I'm not sure if the communication overhead thus incurred would negatively impact your schedule (if you have any)? Sorry for being clueless, I'd like to help but that would take some learning on my part, so just wanted to check if you think a total noob is the right for the job. What do you suggest @Keats? |
No schedule right now, don't worry about it. Git will probably be more problematic than Rust/Zola :) To start with, make sure you work on the
There are some integration tests in Let me know if you need more details on some stuff or if you are overwhelmed! |
Regarding colocated assets, the documentation says it's designed such that we get to use relative paths to link to them, and I think that's nice, for obvious reasons. So I wanted to check with you @Keats if you meant in the comment above to switch to absolute paths for colocated assets as well, or did I misunderstand you? Or perhaps it was meant to be discussed? |
For colocated assets there was an interesting comment earlier: #977 (comment) |
For colocated assets path: I think we want to keep them relative. We can combine them with the page/section permalink easily if we want absolute links. |
Bug Report
Environment
Zola version: 0.11.0
Expected Behavior
The global variable
current_path
should have a consistent format regarding leading and trailing slashes.Current Behavior
http://127.0.0.1/
,current_path
equals/
, which I suppose is the trailing slash;http://127.0.0.1/page/2/
, it equalspage/2/
, so again, with a trailing slash, so far so good;http://127.0.0.1/tags/
, it equalstags
, note the trailing slash is missing;http://127.0.0.1/tags/some-tag/
, it equals/tags/some-tag
, again missing the trailing slash, but also with an apparent leading slash.Step to reproduce
To show this, just use this variable somewhere in the base template, e.g. add
<link href="{{ current_path | safe }}">
in the head?Sorry if this is a known issue, I did search the issues beforehand though.
Last but not least, thanks for creating and developing Zola.
The text was updated successfully, but these errors were encountered: