site.HomePermalink
and site.Home.RelPermalink
? (I use the former in my sitemap and to point the title to the correct homepage for each language. I know absLangURL
would work for the former, but I prefer it this way).
https://gohugo.io/methods/site/home/
Thereâs an example there.
Okay. I searched using site
and it returned blank. I have become used to using site
over .Site
since I saw a comment here months back that the former is âsafeâ context-wise.
So, the other thing⌠that page did not exist last week. I merged a huge change set a few days ago, and the search index hasnât updated yet. Iâm guessing WednesdayâŚ
I saw the change today. Good work! Youâre right coz also .Site
one is missing. Perhaps a build step to force Algolia to refresh the search index could be set up?
Yeah, Iâm not familiar with the Algolia setup, and really donât want to dig into it at the moment. It would be nice if they had an administrative ârefresh the indexâ button somewhere, but I sure canât find it.
Regarding site
vs. .Site
âŚ
In your templates, you are absolutely doing the right thing using the global site
functionâyou always have access to the current Site
object regardless of context.
But in the documentation I waffled a bitâŚ
Understanding context (the dot) is really important. And we access the Site
object a lot. So my thinking was, letâs show .Site
in the docs to get people thinking about what the dot is.
I agree on this. It took me a while to understand it until I saw a comment by @cshoredaniel on how to do it. Still a work in progress though. Specifically using this in my dates partial that cuts across languages, single pages and sections (corrects the Jan 01 0001
issue in sections.)
Yeah, thatâs a good example. But how about recursive contextâŚ
https://gohugo.io/methods/page/page/
Interesting! Luckily, I havenât yet come across an instance that requires using partials in shortcodes.
Ouch! I didnât realize that could be a problem. That complicates life.
Itâs not a problem, just a bit of a mind bender, and very handy for the use case described.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.