If block not working in partial

I can’t seem to get if blocks working in my partials. For example, I have the following if block in my how-it-works.html file:

{{ if .Site.Params.how_it_works }}
<h2>How It Works</h2>
<p>This is how it works</p>
{{ end }}

And in config.toml I have:

logo = "img/logo.svg"

[params.how_it_works]
    enable = true

I haven’t written a block to check enabled just yet as I haven’t been able to progress past this issue. If I remove the if block it loads the partial onto the page.

Where am I going wrong?

Solved. The theme I was modifying is based on an older version of Hugo. I just updated the theme to use with and all works fine.