diff options
-rw-r--r-- | lib/Hakyll/Main.hs | 2 | ||||
-rw-r--r-- | web/site.hs | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/Hakyll/Main.hs b/lib/Hakyll/Main.hs index 2a31137..bdc77cd 100644 --- a/lib/Hakyll/Main.hs +++ b/lib/Hakyll/Main.hs @@ -4,7 +4,7 @@ module Hakyll.Main ( -- * Entry points - , hakyll + hakyll , hakyllWith , hakyllWithArgs , hakyllWithExitCode 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 |