diff options
author | JJ | 2024-08-09 00:46:33 +0000 |
---|---|---|
committer | JJ | 2024-08-09 00:46:33 +0000 |
commit | eee01d0854c6a3d8f53d1634f19dba6f4e90d0ac (patch) | |
tree | 1ce43b0c5614bb3e27c9c883a0ac37aff1cd18fa | |
parent | 31a9142ddf7a54f05b7eb758a41ea088858387fe (diff) |
minor generator update
-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 |