summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--site.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/site.hs b/site.hs
index f25048b..cd6e664 100644
--- a/site.hs
+++ b/site.hs
@@ -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