-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[BUG] iris.Blocks
: mvc
appends .html
erroneously to template names
#1649
Comments
Hello @AlbinoGeek , Yes that's right, I am aware of this. Wil fix it soon. |
OK I fixed it locally. After the commit, you can render templates without file extension, e.g. |
Perhaps I misstated the issue. Currently, none of the following combinations works:
I was originally specifying extensions in all my uses of engine := iris.Blocks("./templates", ".asdf").Layout("base").Reload(true) Even with |
Yes @AlbinoGeek thats because the hero/View's render force-sets the |
Thank you! That allowed me to start using However, ran into a new issue...
The pages render with no layout. However, calling |
Summary
You can't use
Blocks
andmvc
together.Loading your templates (as described in the examples) into
Blocks
causes them to load without the extension, then,mvc
when returning anmvc.View
tacks the erroneous extension back onto the filename, which results in a very unintuitive error in the browser.How do I know this is precisely the issue?
If you rename
index.html
toindex.html.html
-- the error does not occur.Versions, etc.
Reproduction
Code
templates/index.html
templates/layouts/base.html
main.go
Result
The text was updated successfully, but these errors were encountered: