aboutsummaryrefslogtreecommitdiff
path: root/Types.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2023-06-18 17:02:51 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2023-06-18 17:02:51 +0200
commit4a7dcc2dbe64a59c54003802f1d7f0ae898761e4 (patch)
tree1bc77c7d96cd4899ae231b5fb082f1383035c0ff /Types.hs
parent3b13dd83533b5136dba7a8ff334b1d3081d8205d (diff)
downloadreploy-4a7dcc2dbe64a59c54003802f1d7f0ae898761e4.tar.gz
reploy-4a7dcc2dbe64a59c54003802f1d7f0ae898761e4.tar.bz2
split tags and ehtags, separate listings from hierarchical views
Diffstat (limited to 'Types.hs')
-rw-r--r--Types.hs14
1 files changed, 12 insertions, 2 deletions
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