use prefix in dependSingle'

This commit is contained in:
Rhiannon Morris 2020-07-15 20:09:14 +02:00
parent d360121efd
commit 966481dacd

View file

@ -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'|]