Is there a way to tell Hugo to include a file (like a partial) from within the .Content in a page? Here’s my scenario:
I have a site built and published already. I decided I wanted to embed sharing buttons on all of the pages, within the content that I reference with the {{ .Content }} in my single.html template file. The site meets my expectations already, and I just want to insert the buttons in the middle of the page content.
I tried using a reference to a partial file using {{ partial “share_buttons.html” . }} . This works very nicely for my home page content (which is held in a partial file), but does not work for the other pages at all (which invoke {{ .Content }} ). For those pages, the {{ partial “share_buttons.html” . }} simply shows up as text on the resultant web page.
I tried using an html include, which not only seems a little silly when using Hugo, but also fails to work (it shows the share buttons, but everything else is missing). (Of potential note, my content files are .html, not .md files. Not sure if that matters. I’m not actually writing markdown, and my editor color codes the html files nicely, whereas it does not color code the .md files. )
In summary, I’m looking for a way to reference common content (a file) for inclusion in all of my pages from within the {{ .Content }} portion of my pages.
Many Thanks!
Ron