add nsfw class to relevant gallery items
but only on galleries showing nsfw at all
This commit is contained in:
parent
0ffebd2a00
commit
4a08a6bb9a
4 changed files with 23 additions and 11 deletions
|
@ -18,6 +18,7 @@ data ModeOptions =
|
|||
}
|
||||
| GalleryPage {
|
||||
files :: [FilePath],
|
||||
nsfw :: Bool,
|
||||
title :: Text,
|
||||
output :: Maybe FilePath,
|
||||
dataDir :: FilePath
|
||||
|
@ -72,9 +73,13 @@ optionsParser = globalOpts `info` mainInfo where
|
|||
indexInfo = progDesc "generate an index page for all galleries"
|
||||
|
||||
gallery = command "gallery" $ galleryOpts `info` galleryInfo
|
||||
galleryOpts = GalleryPage <$> files <*> title <*> output <*> dataDir
|
||||
galleryOpts =
|
||||
GalleryPage <$> files <*> nsfwG <*> title <*> output <*> dataDir
|
||||
files = many $ strArgument $
|
||||
metavar "FILE..." <> help "yaml files to read"
|
||||
nsfwG = switch $
|
||||
short 'n' <> long "nsfw" <>
|
||||
help "nsfw versions are included"
|
||||
title = strOption $
|
||||
short 't' <> long "title" <> metavar "TITLE" <>
|
||||
help "page title"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue