Closed jillesvangurp closed 8 months ago
Hey @jillesvangurp, use this language switcher https://github.com/zeon-studio/hugoplate/blob/main/layouts/partials/components/language-switcher.html
I have, mine is adapted from that. Both have the same issue.
hey @jillesvangurp, you said that the header switcher works correctly. and we don't give support if anything goes wrong after your customization. we use github issues only for the theme issues, if you need to customize the theme, you can hire us from here https://zeon.studio/estimate-project
Re-open and read this thread https://discourse.gohugo.io/t/language-switcher-used-twice-generating-different/48712/19 cc @tfsomrat
@yaardie that's the exact thread that I started and linked above.
Not using partialCached
like hugoplate does in a lot of places, was the solution here.
Most probably partialCached
is creating the issue, try to remove Cached
when you are calling any functional things in it.
That indeed fixed things for me. To quote Joe (from Hugo)
Can someone please log an issue against hugoplate advising them about what a bad idea this is?
Most probably
partialCached
is creating the issue, try to removeCached
when you are calling any functional things in it.
The issue here is you are following bad coding standards. You should not cache the footer.
What is your Hugo Extended Version
v0.123.8-5fed9c591b694f314e5939548e11cc3dcb79a79c+extended
What is your Go Version
go1.22.1
What is your Node.js Version
v18.18.0
Check for Existing Issues
Expected Behavior
The links for translations in the header and footer are the same
Steps to Reproduce
I added the language switcher component to my header and footer.
Our front page is available in EN and DE.
The header switcher lists correct links. The footer does not and instead seems to show links for different pages on our website.
Code Reproduction URL
No response
Additional Information
Also see discussion here: https://discourse.gohugo.io/t/language-switcher-used-twice-generating-different/48712/5
Our website repository is private so I can't provide a link to that. A preview of our website is available here: https://newwww.tryformation.com