From 4fb6f81d8314140ad65a6099209106c92db3cfba Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 20 Oct 2023 09:04:58 +0200 Subject: support multiple template directories closes #17 --- Types.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index 992c866..a3b65cd 100644 --- a/Types.hs +++ b/Types.hs @@ -56,7 +56,7 @@ data SiteState = SiteState , _sourceDirs :: [FilePath] -- ^ Path to page source data , _notSourceDirs :: [FilePath] -- ^ Subdirectories of source dirs where pages should not be sourced , _tagMetaFile :: FilePath -- ^ Name of the "tag metadata" files to find in the source directories. - , _templateDir :: FilePath -- ^ Path to template directory + , _templateDirs :: [FilePath] -- ^ Paths to template directories , _defaultTemplate :: FilePath -- ^ Name of the default template , _redirectTemplate :: FilePath -- ^ Name of the template for redirect pages , _tagTemplate :: FilePath -- ^ Name of the template for category pages @@ -113,10 +113,12 @@ siteOptions' = do <> help "Name of files with tag metadata" <> value "tag-metadata.yml" <> showDefault - _templateDir <- - strOption + _templateDirs <- + many . strOption $ long "template-directory" - <> help "Path to the directory with templates" + <> short 't' + <> help + "Path to the directory with templates (possibly multiple paths)" <> value "templates" <> showDefault _defaultTemplate <- @@ -162,6 +164,7 @@ siteOptions' = do ++ Y.prettyPrintParseException err in fmap (foldl objMerge Y.Null . map processKeyVal) . many . strOption $ long "extra-metadata" + <> short 'e' <> help "Extra metadata to add to pages rendering in YAML format. May be specified multiple times." _urlBase <- -- cgit v1.2.3