Nested/child HTML in a partial?

The top-level call

{{ partial "a.html" (dict "ctx" . "partialsToRender" (slice "componentA.html" "componentB.html" )) }}

layouts/partials/a.html

{{ range .partialsToRender }}
  {{ if templates.Exists (printf "partials/%s" .) }}
    {{ partial . $.ctx }}
  {{ else }}
    {{ errorf "Partial %q not found" . }}
  {{ end }}
{{ end }}
2 Likes