diff options
-rw-r--r-- | site.hs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -18,9 +18,9 @@ pandocCompiler = pandocCompilerWith readerOptions writerOptions where <> extensionsFromList [Ext_lists_without_preceding_blankline] } --- Loads the template specified in a post's metadata, if it exists -loadLayoutTemplate :: Context String -> Item String -> Compiler (Item String) -loadLayoutTemplate context item = do +-- Applies the template specified in a post's metadata, if it exists +applyMetadataTemplate :: Context String -> Item String -> Compiler (Item String) +applyMetadataTemplate context item = do field <- getMetadataField (itemIdentifier item) "layout" case field of Just path -> @@ -42,14 +42,14 @@ main = hakyll $ do case field of Just _ -> pandocCompiler Nothing -> getResourceBody - >>= loadLayoutTemplate defaultContext + >>= applyMetadataTemplate defaultContext >>= relativizeUrls -- Match all other renderable files and apply their template, if it exists match ("**.md" .||. "**.rst" .||. "**.org" .||. "**.adoc") $ do route $ setExtension "html" compile $ pandocCompiler - >>= loadLayoutTemplate defaultContext + >>= applyMetadataTemplate defaultContext >>= relativizeUrls -- Additionally copy non-HTML files raw, without front matter |