-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
i18n
function does not work in ExecuteAsTemplate
#7070
Comments
i18n
function does not work in ExecuteAsTemplate
I fixed a bug in 0.67.1. Now we use all the arguments to ExecuteAs... when we create the cache key. So:
There is the page (".") and the path (js/copy...). The path is, however, language-agnostic (so to speak), so there is a "first win" situation here. So, if you really want to create a JS per language, try: ...resources.ExecuteAsTemplate (printf "%s/js/copy-rendered.js" .Lang) -}} Also note that re my first comment above, it's not generally a great idea to pass the current page in as the context if you don't produce a "per page" resource (as you would execute the template x number of pages). |
Thanks a lot! |
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
script.html
copy.js
Live demo: https://io-oi.me/en/about/ (with Hugo
v0.66.0
)Hover the code block, the text should be
Copy
instead of复制
.Seems like a degradation? #6331
The text was updated successfully, but these errors were encountered: