Illegal for a shortcode to render a page that calls other shortcodes?

If a page calls a shortcode that in turns renders other page’s content with their own shortcode calls then the latter page’s content is not rendered (no error is printed with verbose flag).

Is this illegal use of shortcodes in hugo or a bug?

That’s a bit of a complex explanation so here’s the basic sequence I use:

  • content/post/main.md - Page to render (front matter omitted)
	...
	{{% loadsomeotherpages %}}
	...
  • layouts/shortcodes/loadsomeotherpages.html
	{{ range where .Page.Site.Pages "Section" "event" }}
		{{ .Content }}
	{{ end }}
  • content/event/pagenotrendered.md - (front matter omitted)
	[Who]({{< relref "about.md" >}}) is the author?

I expect to see “Who is the author?” but it is missing.

However, if I add any other shortcode to main.md (e.g. another relref) then I see “Who is the author?” rendered.

This should be documented better, maybe – but this is all part of the chicken and the egg: The shortcode is rendered before the page and as such knows nothing about the rendered content of the parent container at that moment in time. So I wouldn’t depend on {{ .Page.Content }} and some others.

And this isn’t remotely close to the primary use case of shortcodes.