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

Custom site root doesn't work on Windows #1361

Open
southerntofu opened this issue Feb 18, 2021 · 5 comments
Open

Custom site root doesn't work on Windows #1361

southerntofu opened this issue Feb 18, 2021 · 5 comments
Labels
bug Need Windows help We need someone using Windows to help us with this issue

Comments

@southerntofu
Copy link
Contributor

From the forums

Windows 10, zola 0.13.0

It appears the -r flag is broken on Windows, at least with absolute links, like so:

zola.exe -r "D:\Dev\Zola\zola-clean-blog" build
@Keats
Copy link
Collaborator

Keats commented Feb 22, 2021

@Keats Keats added the bug label Feb 22, 2021
@Keats
Copy link
Collaborator

Keats commented Jul 19, 2021

Is it still happening with 0.14?

@warsus
Copy link

warsus commented Sep 21, 2021

I had the same problem on master branch [0] and did a little analysis.
It appears to me that (at least in my case) the problem might be that the windows canonical path looks like this:

root_dir: \?\C:\Users\user\my_site

My guess is the questionmark in the prefix will later be interpreted as a globbing character.
Tera::parse will create no matches then.

I kinda confirmed this by removing the "canonicalize" call in the root_dir assignment, which fixed the problem for me.

let root_dir = match matches.value_of("root").unwrap() {
    "." => env::current_dir().unwrap(),
    path => PathBuf::from(path)
        .canonicalize()
        .unwrap_or_else(|_| panic!("Cannot find root directory: {}", path)),
}; 

[0] commit 9946506 (HEAD -> master, origin/master, origin/HEAD)

@Keats
Copy link
Collaborator

Keats commented Sep 21, 2021

@warsus thanks for digging!
I can't remember why we're canonicalizing it to be honest. If you can do a PR with that change on the next branch, I'll test on macos.

@warsus
Copy link

warsus commented Sep 21, 2021

@Keats
Sure i will try to do a PR later today. Also i think my assumption about the questionmark was not completly right.
But i still think it's something about the \? prefix, might do some further digging in the tera lib afterwards.

@Keats Keats added the Need Windows help We need someone using Windows to help us with this issue label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Need Windows help We need someone using Windows to help us with this issue
Projects
None yet
Development

No branches or pull requests

3 participants