aboutsummaryrefslogtreecommitdiff
path: root/site.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-06-08 15:03:11 +0200
committerMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-06-08 15:03:11 +0200
commitdc128cbe0e959bb6ae2abb5d5b81794e8b82d049 (patch)
tree58bc3c47ca978b486c6228f57b8c4adb7f543bb6 /site.hs
parent384e56cb53b2f75299a5a95970f800f9fcc76909 (diff)
downloadreploy-dc128cbe0e959bb6ae2abb5d5b81794e8b82d049.tar.gz
reploy-dc128cbe0e959bb6ae2abb5d5b81794e8b82d049.tar.bz2
avoid explosion on people adding abs-path mount
Diffstat (limited to 'site.hs')
-rw-r--r--site.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/site.hs b/site.hs
index 1369457..31e8ecc 100644
--- a/site.hs
+++ b/site.hs
@@ -66,7 +66,9 @@ loadPage fp = do
md <- io $ runIOorExplode $ readMarkdown markdownReadOpts (T.drop 5 markdown)
{- find the main mount point for the page -}
let mount =
- T.unpack . just ("mount point of " ++ fp) $ yml ^? key "mount" . _String
+ dropWhile (== '/') . T.unpack . just ("mount point of " ++ fp) $ yml ^?
+ key "mount" .
+ _String
existing <- use $ pages . to (M.!? mount)
case existing of
Just pi ->