skip nsfw stuff in non-nsfw singlepages

This commit is contained in:
Rhiannon Morris 2020-07-09 21:48:29 +02:00
parent 80cf5cfacc
commit a18786e70c
2 changed files with 38 additions and 17 deletions

View file

@ -49,12 +49,14 @@ main :: IO ()
main = main2 =<< Opt.execParser optionsParser
main2 :: Options -> IO ()
main2 (SinglePage {file, includeNsfw, output}) = do
main2 s@(SinglePage {file, includeNsfw, output}) = do
print s
txt <- ByteString.readFile file
let Right info = YAML.decode1 txt
let page = make info
let page = make includeNsfw info
case output of
Nothing -> Text.putStr page
Just out -> Text.writeFile out page
main2 (GalleryPage {}) = do
main2 g@(GalleryPage {}) = do
print g
error "surprise! this doesn't exist yet"