diff --git a/src/Main.hs b/src/Main.hs index 946d1e0..0491b98 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -45,6 +45,7 @@ config :: Configuration config = defaultConfiguration { destinationDirectory = "public" + , previewPort = 8008 } routeAsFilePath :: (FilePath -> FilePath) -> Routes @@ -63,6 +64,12 @@ metadataSort = sortOnM $ \Item{itemIdentifier} -> maybe (0 :: Integer) read <$> sortOnM :: forall m a b. (Monad m, Ord b) => (a -> m b) -> [a] -> m [a] sortOnM f = fmap (map snd . List.sortOn fst) . mapM (\x -> (,x) <$> f x) +metadataShow :: [Item w] -> Compiler [Item w] +metadataShow = filterM $ \Item{itemIdentifier} -> maybe (True :: Bool) read <$> getMetadataField itemIdentifier "show" + +metadata :: [Item w] -> Compiler [Item w] +metadata = metadataSort <=< metadataShow + unwrapped :: Snapshot unwrapped = "unwrapped" @@ -171,8 +178,8 @@ main = where ctx' = mconcat - [ listField "tags-nav" defaultContext (metadataSort <=< mapM (uncurry renderTagNav) $ tagsMap tags) - , listField "special-nav" defaultContext $ metadataSort =<< mapM (flip loadSnapshot unwrapped) =<< getMatches (fromGlob "special/**") + [ listField "tags-nav" defaultContext (metadata <=< mapM (uncurry renderTagNav) $ tagsMap tags) + , listField "special-nav" defaultContext $ metadata =<< mapM (flip loadSnapshot unwrapped) =<< getMatches (fromGlob "special/**") , frontendContext , defaultContext ] diff --git a/tags/index.md b/tags/index.md index b2ad7e0..34d5a18 100644 --- a/tags/index.md +++ b/tags/index.md @@ -1,4 +1,5 @@ --- title: Index sort: -9999 +show: "False" ---