-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Template execution fails if no suffix is given #13601
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
Comments
I was not able to reproduce this:
In the example above, But the behavior has changed... v0.145.0
v0.146.0
You get the same result in v0.146.0 using As you know, partial templates are agnostic with respect to language and output format. So if you needed both HTML and JSON:
If you have a partial template you intended to use with all output formats, and you want to visually indicate your intent, use a different extension, the value of which is irrelevant.
|
@cmahnke Also, your test site worked fine for me: Note the "en" at the end. |
Thanks @jmooring for having a look. I still see the issue but get what you mean, it's very strage:
gives:
|
OK, the failure is intermittent when the partial file does not have an extension, but works every time when it has an extension. So... give it an extension? This is related to the |
Well, yes, already did that. But it's still an strange result, maybe a race condition, that should be addressed. Or at least looked into. It might be an indicator for broken logic. But it has a lower priority right now. Just in case anyone else get's a:
|
I will have a look at this. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
Description
Up until 0.145 it was possible to call a partial without an file extension from another. My use case were partials
that act as output format agnostic templates function, those might return just strings.
To make it obvious that those aren't really bound to formats, I just used them without any file extension, see
default-lang
in the example. This wont work anymore with the new templating (at least on existing sites).In short: Executing a template (in this case for output format HTML) that doesn't have the file suffix
.html
fails now.Message
Example
https://github.com/cmahnke/hugo-13601
Updates
.html
) makes it work, even if I don't change the caller. My expectation would have been that this should fail, since the template file don't actually exist under the given file name.The text was updated successfully, but these errors were encountered: