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

Throw an error when a custom template is given but not found #129

Closed
choldgraf opened this issue May 7, 2019 · 4 comments · Fixed by #137
Closed

Throw an error when a custom template is given but not found #129

choldgraf opened this issue May 7, 2019 · 4 comments · Fixed by #137
Labels
enhancement New feature or request

Comments

@choldgraf
Copy link
Contributor

I found myself confused recently when I was trying to demo creating a custom template in #126 . I'd run Voila with a custom template like --template=mytemplate, and everything would run fine, but the final output was not the HTML I expected.

Right now, this is because Voila simply appends the custom template path to the list of templates it expects. For me, this led to confusion because I was expecting Voila to error if it didn't find my template path. Instead, it just reverted to the default template.

What do folks think about raising an error in this case, rather than reverting to default? I feel like if somebody gives a custom template, they'd rather know that the path wasn't correctly found, rather than have it silently work, but not in the way expected.

@timkpaine
Copy link
Member

@choldgraf I agree, it should check the path to see if it exists

@SylvainCorlay SylvainCorlay added the enhancement New feature or request label May 13, 2019
@SylvainCorlay
Copy link
Member

Agreed, we should at least inform the user instead of failing silently.

@maartenbreddels
Copy link
Member

Yes, although it will be a bit tricky. We can check if the root dir exists, but nothing more, since we don't know what the reason is for choosing the template. It could be to override custom js, for 404 pages, or the voila.tpl template. But a voila template dir does not need to have a voila.tpl.

@maartenbreddels
Copy link
Member

#137 now checks that at least a directory with that name is found, I think that should solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants