I’ve asked similar questions before, and I guess It’s not currently possible.
But this and similar stuff seems more and more like a very important feature to me.
Take the figure shortcode as an example. I would like to style my figures differently when on the home page.
So one would think that I could access .IsPage
and .IsNode
inside the shortcode, but no.
OK, so then one should believe that I can send it as a parameter in the shortcode itself:
{{% figure src="/img/someimage.jpg" class="{{ .IsPage }}" %}}
But not.
The simple solution is to pass formatting related data on page/node (at least the two above) on to the shortcode data struct.
This is a very quick fix, and I can add a PR for it – but thought I should disucss it here first, maybe someone is seeing an easier or better solution.
And my Hugo-branch has drifted far enough away from master as it is