I am trying to display an iframe on my hugo site.
But no matter what I do, the head and body elements are empty.
They are not getting generated at build time.
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Check your browser console. Most browsers have that by clicking right button on your page, then select “Inspect”. In the console you will see errors. I am pretty sure something along the lines of CSP will come up or something like “not found”. The empty head/body tags are a workaround of your browser to show “nothing”.