title: How can I include a template in another with pandoc?
body: <p>I am using Markdown files to create a series of webpages (calling that mess a website would probably be frowned upon). I use a general template to display each page with a similar look: they all have the same header, footer, etc.</p>
  <p>I would like to add a navigation menu, in order to have links to the other pages. I can easily generate the menu itself, what I don't know is how to insert it in the page.</p>
  <p>What I tried is the following:</p>
  <p><code>options.yml</code> (generated by a Python script):</p>
  <pre class="lang-yaml prettyprint-override"><code>metadata:
    title: My very excellent title
    navigation: &lt;a href=&quot;index.html&quot;&gt;Home&lt;/a&gt;&lt;a href=&quot;other.html&quot;&gt;Other page&lt;/a&gt;
  standalone: true
  template: template.html
  </code></pre>
  <p><code>template.html</code>:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!doctype HTML&gt;
  
  &lt;title&gt;$title$&lt;/title&gt;
  
  &lt;header&gt;Yeepee, header!&lt;/header&gt;
  
  &lt;nav&gt;$navigation$&lt;/nav&gt;
  
  &lt;main&gt;$body$&lt;/main&gt;
  
  &lt;footer&gt;Best footah evah&lt;/footer&gt;
  </code></pre>
  <p>I then run the script: <code>pandoc -d options.yml index.md -o index.html</code> (and same for the other files, in a loop in a Python script)</p>
  <p>The result is that the content of my <code>metadata.navigation</code> is escaped before insertion, resulting in something like <code>&amp;lt;a href=&quot;index.html&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;a href=&quot;other.html&quot;&amp;gt;Other page&amp;lt;/a&amp;gt;</code>, which is really safe in practice, but doesn't help me there.</p>
  <p>What I would like is to have another template, say <code>navigation.html</code>, that contains the navigation menu to be included in my main template when using pandoc.</p>
  <p>If this is not possible, I would like to use the same technique as above, but with an &quot;unescaped&quot; <code>navigation</code> parameter (I'm not fond of it, as it would bring a major security issue into the project).</p>
  <p>How can I achieve this?</p>