A Partial with a Param inside of it

Hi, is it somehow possible to use a partial with content from a Param (from the markdown file).

Basically trying to do this:
{{ partial “product-descriptions/{{ .Params.product_name }}.html” . }}

Thanks in advance for any help.

Something like this:

{{ partial (printf “product-descriptions/%s.html” .Params.product_name) . }}

Hope I got the parens lined up correctly.

1 Like

Thanks for the reply :slight_smile: - With the example you gave I get:

error calling partial: partial "product-descriptions/%!s(<nil>).html" not found

The <nil> is a clue that .Params.product_name is not defined on the page.

1 Like

Ah yes that template was using other markdown files as well - got it working now :slight_smile:

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