From 966481dacdf5e001590e838176204c301411450c Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Wed, 15 Jul 2020 20:09:14 +0200 Subject: [PATCH] use prefix in dependSingle' --- make-pages/Depend.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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'|]