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

Confusing result when missing partial files #53

Open
JakeShirley opened this issue Aug 17, 2021 · 3 comments
Open

Confusing result when missing partial files #53

JakeShirley opened this issue Aug 17, 2021 · 3 comments

Comments

@JakeShirley
Copy link

Sorry if this isn't 100% correct, I am really new to Rust.

When loading a directory of templates I got an odd error message. I eventually found out it is because my partial templates were not found on disk, but I had no idea which ones! I was able to eventually find it but it was a little cumbersome.

NOTE: My main issue was that I wasn't including the file extension in the partial names.

Example:
template.mustache

This is my template: {{> partial_that_isnt_on_disk.mustache}}

Error message:

thread 'main' panicked at 'Failed to load mustache templates: Io(Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." })'
@maciejhirsz
Copy link
Owner

Are you using latest version? It should have been fixed in #51.

@JakeShirley
Copy link
Author

Are you using latest version? It should have been fixed in #51.

Looks like I am using 0.12.0

@grego
Copy link
Contributor

grego commented Dec 3, 2021

Could you, please, show the piece of code where the panic happened?

grego added a commit to grego/ramhorns that referenced this issue Dec 4, 2021
Adds functions `extend_from_folder` and `extend_from_folder_with_extension`
to include templates from another folder in the collection.
If there is a file with the same name as a previously loaded template or partial,
it will not be loaded.
Also, this should fix the issue maciejhirsz#53 (the name of the partial which was not found
should always be returned).
grego added a commit to grego/ramhorns that referenced this issue Dec 4, 2021
Adds functions `extend_from_folder` and `extend_from_folder_with_extension`
to include templates from another folder in the collection.
If there is a file with the same name as a previously loaded template or partial,
it will not be loaded.
Also, this should fix the issue maciejhirsz#53 (the name of the partial which was not found
should always be returned).
maciejhirsz pushed a commit that referenced this issue Dec 13, 2021
…#57)

Adds functions `extend_from_folder` and `extend_from_folder_with_extension`
to include templates from another folder in the collection.
If there is a file with the same name as a previously loaded template or partial,
it will not be loaded.
Also, this should fix the issue #53 (the name of the partial which was not found
should always be returned).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants