-
Notifications
You must be signed in to change notification settings - Fork 971
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
base_url = "/" is broken on Windows #2076
Comments
The problematic section of code is here:
|
I'll need someone on Windows to write a failing test and fix it as I don't have a machine available (that and #1626) |
Using It is possible to use a filter as a temporary mitigation, but it isn't very pretty.
Something like |
The solution is to have a separate
|
I think the more immediate issue is to remove the problematic check. People using backslashes as paths silently failing is suboptimal, but failing to build perfectly valid setups is much worse IMO. |
Well it was added to fix a bug so just removing it is not acceptable either. |
I disagree. The bug in question is #1632. The whole origin of this bug is that the user expects links in the Markdown such as The test asset path in |
That's fair enough, I didn't look back at the issue, just at the git blame talking about a bug. |
Actually, looking at it, the whole test case can be removed, since its whole purpose was to test whether directly passing OS paths into the |
Bug Report
Using
/
as yourbase_url
is broken on Windows, it works on macOS.Environment
Windows 10
Zola version: 0.16.1
Expected Behavior
I expect
/
to be used as the base url, such that for exampleget_url(path="assets/style.css")
resolves to/assets/style.css
.This is useful for being domain / ip address agnostic (and in fact probably should be the default for
zola serve
as opposed to hardcoding127.0.0.1
).Current Behavior
It works as I expect on macOS. On Windows I get the following error when running
zola build
:Step to reproduce
Set
/
as yourbase_url
and attempt to use theget_url
builtin on Windows.The text was updated successfully, but these errors were encountered: