From 6c81f761d66c8deacfe59aab145c1370c12e21d8 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Fri, 5 Dec 2025 13:26:09 -0500 Subject: [PATCH] wrote out the scaffolding for work to do a live server later --- TODO.md | 1 + app/Main.hs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index f1ae1cf..d4ba241 100644 --- a/TODO.md +++ b/TODO.md @@ -6,4 +6,5 @@ - [ ] dev server setup (with live reloading) - https://hackage-content.haskell.org/package/warp-3.4.10 - https://hackage.haskell.org/package/file-embed + - https://hackage.haskell.org/package/fsnotify - [ ] see if performance can be improved (it isn't slow atm but it definitely feels like there's a bottleneck) diff --git a/app/Main.hs b/app/Main.hs index dd61978..3edaec9 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -28,9 +28,10 @@ import Utilities.FilePath (indexHtmlOutputPath, indexHtmlSourcePaths, isMarkdown -- Rule = pattern of thing being made + actions to produce the thing -- Action = actions to produce a thing +-- note: live watch should be done outside of shake with the watcher then running shake which is rather annoying main :: IO () main = do - Shake.shakeArgs Shake.shakeOptions {Shake.shakeProgress = Shake.progressSimple} $ do + Shake.shakeArgs Shake.shakeOptions {Shake.shakeProgress = psbProgress} $ do Shake.withTargetDocs "Build the site" $ "build" ~> buildSite Shake.withTargetDocs "Clean the built site" $ @@ -168,3 +169,6 @@ postHandles = [(isMarkdownPost, markdownToPost)] isDraft :: FilePath -> Action Bool isDraft = isDraft' postHandles + +psbProgress :: IO Shake.Progress -> IO () +psbProgress = Shake.progressDisplay 0.01 putStrLn