Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Feb 26, 2020
1 parent 178c1df commit d143a4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Hakyll/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Hakyll.Main
( -- * Entry points
, hakyll
hakyll
, hakyllWith
, hakyllWithArgs
, hakyllWithExitCode
Expand Down
13 changes: 9 additions & 4 deletions web/site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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


--------------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d143a4d

Please sign in to comment.