Is it possible to add partial templates into the content?

Couldn’t you use a shortcode for this? https://gohugo.io/extras/shortcodes. Also, you can put the previous code in the block template, or the single layout rather than having to put that code on every post page. If there are some pages where it’s not required you could give it a front matter parameter to toggle, or just use the isset as your check.