diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-10-13 20:45:36 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-10-13 20:45:36 +0200 |
| commit | 5304dd384c12280ba5e920905cc84e877f2df8d2 (patch) | |
| tree | bcf3cb5f48d464e6145fcc6f1b3c5710db6e896a /Types.hs | |
| parent | 4cdbf598c0e343384f8af3421d332ed15d8afe4e (diff) | |
| download | reploy-5304dd384c12280ba5e920905cc84e877f2df8d2.tar.gz reploy-5304dd384c12280ba5e920905cc84e877f2df8d2.tar.bz2 | |
generalize the options a bit, allow assets from multiple directories
Diffstat (limited to 'Types.hs')
| -rw-r--r-- | Types.hs | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -22,7 +22,6 @@ module Types where import Control.Monad.Trans.State.Lazy import qualified Data.ByteString.UTF8 -import Data.List.NonEmpty (nonEmpty, toList) import qualified Data.Map as M import qualified Data.Set as S import qualified Data.Yaml as Y @@ -66,7 +65,7 @@ data SiteState = , _templates :: M.Map FilePath Mu.Template , _outputDir :: FilePath -- ^ Directory for output , _searchDataOut :: Maybe FilePath -- ^ File to write the searchable versions of pages to (as JSON) - , _assetDir :: FilePath -- ^ Directory for output + , _assetDirs :: [FilePath] -- ^ Directory for output , _sourceDirs :: [FilePath] -- ^ Path to page source data , _notSourceDirs :: [FilePath] -- ^ Subdirectories of source dirs where pages should not be sourced , _templateDir :: FilePath -- ^ Path to template directory @@ -101,23 +100,21 @@ siteOptions' = do long "search-data-output" <> help "Output JSON with searchable page data to this file") <|> pure Nothing - _assetDir <- - strOption $ + _assetDirs <- + many . strOption $ long "assets" <> short 'a' <> - help "Assets directory to be copied verbatim" <> - value "assets" <> showDefault + help "Assets directory to be copied verbatim (possibly multiple paths)" _sourceDirs <- - fmap (maybe ["pages"] toList . nonEmpty) . many . strOption $ + many . strOption $ long "source-directory" <> short 's' <> - help - "Path to the directory with source data (possibly multiple paths, defaults to a single directory \"pages\")" + help "Path to the directory with source data (possibly multiple paths)" _notSourceDirs <- - fmap (maybe ["assets"] toList . nonEmpty) . many . strOption $ + many . strOption $ long "exclude-source-directory" <> help - "Names of subdirectories of the sources that should never be used for sourcing pages (possibly multiple directory names, defaults to a single directory \"assets\")" + "Names of subdirectories of the sources that should never be used for sourcing pages (possibly multiple directory names)" _templateDir <- strOption $ long "template-directory" <> @@ -126,7 +123,7 @@ siteOptions' = do _defaultTemplate <- strOption $ long "default-template" <> - help "Default template to use for stuff (found in templates directory)" <> + help "Default template to use for stuff (as found in templates directory)" <> value "default.html" <> showDefault _redirectTemplate <- strOption $ |
