Should these methods be documented?

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).

1 Like

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…

1 Like

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.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.