I am using Hugo 0.16. (I cannot upgrade to Hugo 0.18)
My entire site is written in Markdown except the home page in /layouts/index.html That page (obviously) has the template for the site, but the content there has HTML markup.
Is there a way to use Markdown text there? Many thanks.
Is there some kind of ‘include’ facility that would allow me to place the actual content of the index.html page in the /content/ directory? That would keep all the content for the site in one place…
I’m hoping there’s a way to do something like:
{{ {{ include /content/index.md }} | markdownify }}
Not include since that’s not part of the Hugo syntax, but you can get close. I think this worked for me on an old site I built in 16 or 17:
Create a partial in layouts/partials/homepage.html
Write the text inside of homepage.html in markdown, even though it has the .html file extension.
Use {{partial "homepage.html" . | markdownify }} in layouts/index.html.
That said, if you’re comfortable with the upgrade, it’s a lot less hackish to go the every-page-is-a-page route with _index.md, as mentioned by @budparr.