summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2020-02-26 13:25:26 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2020-02-26 13:25:26 +0100
commitd143a4d490f567a1d911e824d23a3fe4d0e582c5 (patch)
tree533f9f3e85c2731c199eca5f4058254564a93a6e /web
parent178c1df0de27bed8c28190bb4435ddfb88e4eb13 (diff)
downloadhakyll-d143a4d490f567a1d911e824d23a3fe4d0e582c5.tar.gz
Fix compilation issues
Diffstat (limited to 'web')
-rw-r--r--web/site.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/site.hs b/web/site.hs
index cb3ade4..dc86b69 100644
--- a/web/site.hs
+++ b/web/site.hs
@@ -3,12 +3,11 @@
import Control.Arrow (second)
import Control.Monad (filterM, forM_)
import Data.List (isPrefixOf, sortBy)
-import Data.Monoid ((<>))
import Data.Ord (comparing)
import Hakyll
import System.Directory (copyFile)
import System.FilePath (dropTrailingPathSeparator, splitPath)
-import Text.Pandoc
+import qualified Text.Pandoc as Pandoc
--------------------------------------------------------------------------------
@@ -67,10 +66,16 @@ main = hakyllWith config $ do
match "templates/*" $ compile templateCompiler
where
withToc = defaultHakyllWriterOptions
- { writerTableOfContents = True
- , writerTemplate = Just "$toc$\n$body$"
+ { Pandoc.writerTableOfContents = True
+ , Pandoc.writerTemplate = Just tocTemplate
}
+ -- When did it get so hard to compile a string to a Pandoc template?
+ tocTemplate =
+ either error id $ either (error . show) id $
+ Pandoc.runPure $ Pandoc.runWithDefaultPartials $
+ Pandoc.compileTemplate "" "$toc$\n$body$"
+
--------------------------------------------------------------------------------
config :: Configuration