From 4a7dcc2dbe64a59c54003802f1d7f0ae898761e4 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 18 Jun 2023 17:02:51 +0200 Subject: split tags and ehtags, separate listings from hierarchical views --- Types.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index e6455d5..beb008d 100644 --- a/Types.hs +++ b/Types.hs @@ -36,6 +36,9 @@ data SiteState = -- | Map of tags, assigning to each tag sequence a list of -- tagged page mounts , _htags :: M.Map [String] [FilePath] + -- | Map of tags, assigning to each tag sequence a list of tagged page + -- mounts. This one is expanded (tags imply parent categories). + , _ehtags :: M.Map [String] [FilePath] -- | List of installed files (enables sharing) , _installs :: S.Set (String, FilePath) -- | List of installed files (prevents overwriting) @@ -50,7 +53,8 @@ data SiteState = , _templateDir :: FilePath -- ^ Path to template directory , _defaultTemplate :: FilePath -- ^ Name of the default template , _redirectTemplate :: FilePath -- ^ Name of the template for redirect pages - , _tagTemplate :: FilePath -- ^ Name of the template for tag listing pages + , _tagTemplate :: FilePath -- ^ Name of the template for category pages + , _listTemplate :: FilePath -- ^ Name of the template for listing pages , _urlBase :: FilePath -- ^ "Root route" to prepend to all absolute links. , _dumpFinalState :: Bool -- ^ Triggers printing out the structure when the processing finishes. } @@ -105,8 +109,13 @@ siteOptions' = do _tagTemplate <- strOption $ long "tag-template" <> - help "Template for making tag-listing pages" <> + help "Template for making category view pages" <> value "tag.html" <> showDefault + _listTemplate <- + strOption $ + long "list-template" <> + help "Template for making tag-listing pages" <> + value "list.html" <> showDefault _urlBase <- strOption $ long "url-base" <> @@ -121,6 +130,7 @@ siteOptions' = do { _pages = M.empty , _redirects = M.empty , _htags = M.empty + , _ehtags = M.empty , _installs = S.empty , _targets = S.empty , _templates = M.empty -- cgit v1.2.3