diff --git a/make-pages/Depend.hs b/make-pages/Depend.hs index ed04f0a..4ccb7e1 100644 --- a/make-pages/Depend.hs +++ b/make-pages/Depend.hs @@ -1,26 +1,27 @@ module Depend where +import BuildVar import Info hiding (Text) -import Data.Foldable -import System.FilePath + +import Data.Maybe (fromMaybe) import Data.Text.Lazy (Text) import Data.Text.Lazy.Builder (toLazyText) -import BuildVar +import System.FilePath dependSingle' :: FilePath -- ^ yaml file name (relative to data dir!) -> Info + -> FilePath -- ^ output prefix -> FilePath -- ^ build dir -> Bool -- ^ include nsfw? -> Text -dependSingle' yaml info build nsfw = - let dir = build takeDirectory yaml +dependSingle' yaml info prefix build nsfw = + let dir = build prefix takeDirectory yaml images = if nsfw then #images info else filter #sfw $ #images info paths = map #path images index = dir "index.html" - deps = map (dir ) $ - thumbFile (thumbnail info) : map pageFile paths ++ paths - deps' = unwords deps + deps = thumbFile (thumbnail info) : map pageFile paths ++ paths + deps' = unwords $ map (dir ) deps in toLazyText [b|$@index: $@deps'|]