readFile does not parse shortcodes

@Harun, @vit.pankin

@Weru
Does this still work for you in 0.55.6?

No it doesn’t, the child-file shortcodes are not processed. In fact, I observed that the readFile function reads the child files as plain text.

I tried an alternative approach using the GetPage function:

<!-- file shortcode -->
{{ $file := .Get 0 }}
{{ $page := .Site.GetPage $file }}
{{ with $page }}
  {{ .Content }}
{{ end }}
<!-- call the shortcode from content files -->
{{< file "about.md" >}}

It works well; all the shortcodes are all processed :slight_smile: .

5 Likes