Enabling use of a partial if a module is in hugo.toml

At the moment if I have a partial that is only available to the theme if I also have added a certain module to hugo.toml I wrap it in a param and check that the param is true. (E.g.

{{- if eq (.Param "addLQIPStyles") true -}}
    {{- partial "helpers/lib/image-handling/add-styles-for-images.html" .Page -}}
{{- end -}}

My question is if there is (or if it a reasonable feature to request) a way to check for the presence of a module in a template (is there some template config that could set the param, for example)?

1 Like

A couple of things come to mind…

2 Likes

templates. Exists looks perfect. Thank you. I missed that somehow.

1 Like

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