title: Custom content on a tags page
body: <p>I have setup Hakyll to generate basic tag pages from blog posts as follows:</p>
  
  <pre><code>main = do    
      hakyll $ do
  
          match "preambles/*.md" $ compile $ pandocCompiler &gt;&gt;= relativizeUrls
  
          tags &lt;- buildTags "posts/*.md" (fromCapture "tags/*.html")
  
          tagsRules tags $ \tag pattern -&gt; do
              let title = "Posts tagged \"" ++ tag ++ "\""
              route idRoute
              compile $ do
                  posts &lt;- recentFirst =&lt;&lt; loadAll pattern
                  preamble &lt;- loadBody $ fromFilePath ("preambles/" ++ tag ++ ".html")
                  let ctx = constField "title" title
                          `mappend` listField "posts" postCtx (return posts)
                          `mappend` bodyField preamble
                          `mappend` defaultContext
  
                  makeItem ""
                      &gt;&gt;= loadAndApplyTemplate "templates/tag.html" ctx
                      &gt;&gt;= loadAndApplyTemplate "templates/default.html" ctx
                      &gt;&gt;= relativizeUrls
  ...
  </code></pre>
  
  <p>I would like to be able to supply an optional preamble for each page.</p>
  
  <p>To do this I would expect to have a markdown file per tag in a <em>preambles</em> directory, and attempt to use these when building the tags pages. However, I can't figure out how to make this optional, because <code>loadSnapshot</code> will <code>fail</code> if not found.</p>
  
  <p>Is this an appropriate approach, and if so, how would I handle missing data?</p>
  
  <p>Also, I'm not sure that <code>bodyField</code> is the appropriate way to pass the data to the template.</p>