summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJJ2024-08-09 00:46:33 +0000
committerJJ2024-08-09 00:46:33 +0000
commiteee01d0854c6a3d8f53d1634f19dba6f4e90d0ac (patch)
tree1ce43b0c5614bb3e27c9c883a0ac37aff1cd18fa
parent31a9142ddf7a54f05b7eb758a41ea088858387fe (diff)
minor generator update
-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