Markdown pages
Markdown page templates are provided additional .Markdown field on top of usual contents of TemplateContent. Markdown field contains two fields:
.Content: This is the HTML equiavalent of the content of*.mdfile that is the"markdown-page"is currently called for. You are expected to write the content of this field to an appropriate place in your template..Toc: This is a tree of nodes, representing “Table of Contents”. Note that, since a markdown page is okay to have more than oneH1title, the TOC starts with a dummy root, representing a H0 with no renderable title. You only need to iterate on its children to access H1s. Printing a Toc require recursive templating.
{{define "markdown-page"}}
<html>
<body>
<main>{{trustedHtml .Markdown.Content}}</main>
<aside>{{trustedHtml .Markdown.Toc}}</aside>
</body>
</html>
{{end}}
See the Escaping section for trustedHtml.