diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-19 00:09:47 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-19 00:09:47 +0200 |
| commit | 87ee5df0fea1f271d2160fe68b0d6280250bd426 (patch) | |
| tree | 6087c6c3183f9de0faad59c238cadac6291439c9 /site.hs | |
| parent | 6cd0b9f6631d14f66c4b994771dee60ef74b270c (diff) | |
| download | reploy-87ee5df0fea1f271d2160fe68b0d6280250bd426.tar.gz reploy-87ee5df0fea1f271d2160fe68b0d6280250bd426.tar.bz2 | |
style
Diffstat (limited to 'site.hs')
| -rw-r--r-- | site.hs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3,7 +3,7 @@ -- | The main deployment script. module Main where -import Control.Monad ((>=>), unless, when, join) +import Control.Monad ((>=>), join, unless, when) import Control.Monad.Extra (whenM) import Control.Monad.Trans.State.Lazy import qualified Data.Aeson as AE @@ -184,12 +184,11 @@ addTOC pi doc meta@(Y.Object meta') = let go n = do toc <- io . runIOorExplode $ writeHtml5String htmlWriteOpts $ - withPandocBlocks - (pure . toTableOfContents (tocWriteOpts n)) - doc + withPandocBlocks (pure . toTableOfContents (tocWriteOpts n)) doc pure . Y.Object $ KM.insert "toc" (Y.String toc) meta' in case ( pi ^? pageMeta . key "toc" . _Bool - , join $ pi ^? pageMeta . key "toc" . _Number . to Data.Scientific.toBoundedInteger) of + , join $ pi ^? pageMeta . key "toc" . _Number . + to Data.Scientific.toBoundedInteger) of (Just False, _) -> pure meta (_, Nothing) -> go (3 :: Int) (_, Just n) -> go n |
