I’m using Hugo for a website, which is mostly static content but which contains some PHP pages. I’ve followed this guide to set up some PHP compatibility, and with shortcodes it works fine.
But for some major pages I want to have PHP content in the template files, and this is where I’m running into trouble. For example, I have an index.php
template, and when I build the project, <?php
gets changed to <?php
. Even worse, if I mix in PHP inside HTML attributes, the project won’t even build at all as Hugo complains about an error while rendering the HTML.
How can I get Hugo to just leave my template alone? Or do you have any other suggestions? Thanks.