Add CARGO_MANIFEST_DIR as second templates default location#703
Open
useche wants to merge 1 commit intoaskama-rs:mainfrom
Open
Add CARGO_MANIFEST_DIR as second templates default location#703useche wants to merge 1 commit intoaskama-rs:mainfrom
CARGO_MANIFEST_DIR as second templates default location#703useche wants to merge 1 commit intoaskama-rs:mainfrom
Conversation
template. In build environments where `CARGO_MANIFEST_DIR` is not set, the templates paths are prepended with a `templates` directory that doesn't exist in a random place. For instance, in Android's Soong, askama ends up looking for the `templates` directory in the root of the Android code. By adding the `root` directory as well, it gives us the chance to specify a relative path from wherever the compilation happens. Note that this cannot be solved with `askama.toml` either because its location is tied to `CARGO_MANIFEST_DIR` too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In build environments where
CARGO_MANIFEST_DIRis not set, the templates paths are prepended with atemplatesdirectory that doesn't exist in a random place. For instance, in Android's Soong, askama ends up looking for thetemplatesdirectory in the root of the Android code. By adding therootdirectory as well, it gives us the chance to specify a relative path from wherever the compilation happens.Note that this cannot be solved with
askama.tomleither because its location is tied toCARGO_MANIFEST_DIRtoo.