fix mounts
This commit is contained in:
parent
a1a3f0640b
commit
86c711821b
6
site.hs
6
site.hs
|
@ -63,7 +63,11 @@ 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 "title" . _String
|
||||
T.unpack . just ("mount point of " ++ fp) $ yml ^? key "mount" . _String
|
||||
existing <- use $ pages . to (M.!? mount)
|
||||
case existing of
|
||||
Just pi -> error $ "mount for " ++ fp ++ " already exists from " ++ _pagePath pi
|
||||
_ -> pure ()
|
||||
{- save to the state -}
|
||||
pages %=
|
||||
M.insert mount PageInfo {_pagePath = fp, _pageMeta = yml, _pageDoc = md}
|
||||
|
|
Loading…
Reference in a new issue