Skip to content

Using doT and Markdown

Szymon Witamborski edited this page Oct 7, 2013 · 3 revisions

doT expressions, HTML and markdown may be combined freely in any page or partial. The compiler will first convert any doT expressions that were found, and then runs the content through a markdown compiler, so the following code is a valid page/partial:

{
  "title": "Contact information",
  "body_class": "contact",
  "template": "default",
}

# Contact information

{{= it.include("contact") }}

<footer>
  {{= it.include("footer") }}
</footer>

It does need to be kept in mind that the markdown compiler will insert a <p></p> for newlines, so care should be taken when extensively combining markdown and HTML.

Finally, while specifying template and partial file extensions is optional (there is no difference between {{= it.include("footer.md") }} and {{= it.include("footer") }}), the markdown compiler will only be run if the extension of a given file include .md.

Clone this wiki locally