diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-06 20:23:23 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-07 00:01:14 +0200 |
| commit | 86c711821b650873b91031b113163f9c9d7dfc67 (patch) | |
| tree | d2814eb7d5c618131cd92725966384aafd1d896d | |
| parent | a1a3f0640b78917bdf63e0f20b7a37de8b5dcb68 (diff) | |
| download | reploy-86c711821b650873b91031b113163f9c9d7dfc67.tar.gz reploy-86c711821b650873b91031b113163f9c9d7dfc67.tar.bz2 | |
fix mounts
| -rw-r--r-- | site.hs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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} |
