Skip to content

Commit

Permalink
flake: Switch to newer version of Hakyll
Browse files Browse the repository at this point in the history
  • Loading branch information
slotThe committed Nov 15, 2024
1 parent 84034e1 commit 8a50a58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
})
"-f html-sidenotes"
{ };
hakyll = self.callCabal2nix "hakyll" (builtins.fetchGit {
url = "https://github.com/jaspervdj/hakyll";
rev = "61b6e1a32548902eb6feedebf0c0625b61e47947";
}) {};
});
in {
# nix build
Expand All @@ -44,6 +48,7 @@
p.fonttools # Compressing fonts
p.brotli # Compressing fonts
(p.pygments.overrideAttrs (old: {
# https://github.com/pygments/pygments/pull/2789
version = "2.18.1b";
src = fetchFromGitHub {
owner = "slotThe";
Expand Down
21 changes: 1 addition & 20 deletions src/site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -433,25 +433,6 @@ mkCleanSnapshot name item = item <$
-----------------------------------------------------------------------
-- Compilers

-- | Like 'renderPandocWithTransformM', but work on an 'Item' 'Pandoc'
-- instead of just a 'Pandoc'.
myRenderPandocWithTransformM
:: ReaderOptions -> WriterOptions
-> (Item Pandoc -> Compiler (Item Pandoc))
-> Item String
-> Compiler (Item String)
myRenderPandocWithTransformM ropt wopt f i =
writePandocWith wopt <$> (f =<< readPandocWith ropt i)

-- | Like 'pandocCompilerWithTransformM', but work on an 'Item' 'Pandoc'
-- instead of just a 'Pandoc'.
myPandocCompilerWithTransformM
:: ReaderOptions -> WriterOptions
-> (Item Pandoc -> Compiler (Item Pandoc))
-> Compiler (Item String)
myPandocCompilerWithTransformM ropt wopt f =
getResourceBody >>= myRenderPandocWithTransformM ropt wopt f

myWriter :: WriterOptions
myWriter = defaultHakyllWriterOptions{ writerHTMLMathMethod = KaTeX "" }

Expand All @@ -469,7 +450,7 @@ pandocRssCompiler = pandocCompilerWorker pure

pandocCompilerWorker :: (Item Pandoc -> Compiler (Item Pandoc)) -> Compiler (Item String)
pandocCompilerWorker =
myPandocCompilerWithTransformM
pandocItemCompilerWithTransformM
myReader
myWriter
-- Only the `title' should be <h1>. This needs to be here so that
Expand Down

0 comments on commit 8a50a58

Please sign in to comment.