-
Notifications
You must be signed in to change notification settings - Fork 638
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
Names generation for precompiled templates on windows. #698
Comments
I'd be ok with either of those proposals; PR welcome! Always using Unix-style by default is a change that would probably need to wait for 3.0, since it's backwards-incompatible. |
Same problem here. We run some dev machines on Windows, so their template cannot be loaded since their paths contain @carljm: I think this is a bug, not just an enhancement since it breaks precompiling templates on Windows. |
@botic Well, it means that templates precompiled on Windows cannot be used on Unix, and vice versa. If you were in a consistently Windows environment, it wouldn't be broken, would it? I think the right solution is to normalize to Unix-style pathnames. Whether it's a bug or an enhancement doesn't really matter; either way it'll get done when someone makes a pull request (shouldn't be too hard). The real question is whether we can safely add it in 2.x or whether it's a backwards-incompatible change that needs to wait for 3.0. Which boils down to the question of whether there are a significant number of current nunjucks users on Windows who already have code that refers to their templates using the backslashed name. It wouldn't take much to convince me that that's probably not the case. |
Is there a fix in 3.0 for that ? |
I'm trying to re-organise my templates in subdirectories. But since I use windows, pre-generated template names look like:
pages\\dashboard\\index.html
, which is very inconvenient, especially if we decide to pre-compile templates on our rundeck machines. I probably could try to use a custom loader, but I'd suggest to either always use unix-style addresses for auto-generated template names, or give an option to customise template names generation, by providing a function as aname
option forprecompile
method.The text was updated successfully, but these errors were encountered: