Hiding content from .Pages

I have a privacy policy page. I want it to be themed instead of static. If I make it content, it will show up in .Data.Pages in the homepage.

From what I’ve seen the workaround is to either make it static, or do some kind of {{ if }} or filter on the .Pages list. But doing the filter method breaks the “Open/Closed” principle, i.e. it’s dirty.

When seeing how the 404 page works, which also isn’t “content”, you just add a layouts/404.html. So it seems reasonable to say all html files directly under layouts/ root should be rendered. But it seems that only index.html and 404.html are rendered.

What do I need to do to make this work?

Has Uncle Bob told you this?

1 Like