Use correct recipe-specific output dir
This commit is contained in:
parent
e770a350d6
commit
bd6ede1df9
|
@ -11,19 +11,19 @@ thumbnailImagePath outputDir filename = do
|
|||
|
||||
handleRecipeDir :: Token FilePath -> Token Template -> Token FilePath -> Token FilePath -> DepGenM ()
|
||||
handleRecipeDir outputDir template indexName dir = do
|
||||
recipeDirOut <- joinPaths (outputDir, dir)
|
||||
makeDir recipeDirOut
|
||||
dirContents <- listDirectory dir
|
||||
exts <- unzipSndDepGenM (mapDepGenM fileComponents dirContents)
|
||||
areImageFilenames <- mapDepGenM isImageExtension exts
|
||||
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
||||
imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames
|
||||
imagePathsOut <- mapDepGenM (curry joinPaths outputDir) imageFilenames
|
||||
imagePathsOut <- mapDepGenM (curry joinPaths recipeDirOut) imageFilenames
|
||||
mapDepGenM_ copyFile' (ZipToken (imagePaths, imagePathsOut))
|
||||
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath outputDir) imageFilenames
|
||||
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath recipeDirOut) imageFilenames
|
||||
mapDepGenM_
|
||||
(\files -> convertImage (files, inject $ ResizeToWidth 800))
|
||||
(ZipToken (imagePaths, thumbnailImagePaths))
|
||||
recipeDirOut <- joinPaths (outputDir, dir)
|
||||
makeDir recipeDirOut
|
||||
htmlBody <- runPandoc (joinPaths (dir, inject "ret.md"))
|
||||
html <- applyTemplate (template, htmlBody)
|
||||
saveFile (html, joinPaths (recipeDirOut, indexName))
|
||||
|
|
Loading…
Reference in New Issue