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

.ReadingTime fails in i18n templates #10782

Closed
nunomazer opened this issue Mar 3, 2023 · 6 comments · Fixed by #10787
Closed

.ReadingTime fails in i18n templates #10782

nunomazer opened this issue Mar 3, 2023 · 6 comments · Fixed by #10787

Comments

@nunomazer
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.111.0
hugo v0.111.1

Does this issue reproduce with the latest release?

Yes

@jmooring
Copy link
Member

jmooring commented Mar 3, 2023

I cannot reproduce on Linux or Windows 11 when layouts/_default/single.html contains

{{ .ReadingTime }}

So, we will need a bit more information...

@bep bep added this to the v0.111.2 milestone Mar 4, 2023
@bep
Copy link
Member

bep commented Mar 4, 2023

So, I understand the what but not the how/where. To get the page global template func working, we added the context.Context as first argument to the methods that needed the page, but we have plenty of tests for this ... Do you pass the page into the i18n function? I guess that is possible, but not something I have done/seen myself.

@bep bep changed the title <.ReadingTime>: wrong number of args after install 0.111.1 .ReadingTime fails in i18n templates Mar 4, 2023
@bep bep self-assigned this Mar 4, 2023
@bep
Copy link
Member

bep commented Mar 4, 2023

OK, thinking about this, this must be the language strings templates. That runs its own template setup (missing all of the template funcs etc.) which finally got very visible and needs a fix.

bep added a commit to bep/hugo that referenced this issue Mar 4, 2023
This is a workaround. We need to improve on this, but not today.

Fixes gohugoio#10782
bep added a commit to bep/hugo that referenced this issue Mar 4, 2023
This is a workaround. We need to improve on this, but not today.

Fixes gohugoio#10782
@nunomazer
Copy link
Author

Thanks @bep for quick answer. I am not the theme creator, I'm using https://github.com/razonyang/hugo-theme-bootstrap.

I cannot reproduce on Linux or Windows 11 when layouts/_default/single.html contains

{{ .ReadingTime }}

So, we will need a bit more information...

Sorry I am not the theme creator and don't know Hugo enough to answer. I'm using https://github.com/razonyang/hugo-theme-bootstrap.

@bep
Copy link
Member

bep commented Mar 4, 2023

@bep bep closed this as completed in #10787 Mar 4, 2023
bep added a commit that referenced this issue Mar 4, 2023
This is a workaround. We need to improve on this, but not today.

Fixes #10782
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants