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 :: Token FilePath -> Token Template -> Token FilePath -> Token FilePath -> DepGenM ()
|
||||||
handleRecipeDir outputDir template indexName dir = do
|
handleRecipeDir outputDir template indexName dir = do
|
||||||
|
recipeDirOut <- joinPaths (outputDir, dir)
|
||||||
|
makeDir recipeDirOut
|
||||||
dirContents <- listDirectory dir
|
dirContents <- listDirectory dir
|
||||||
exts <- unzipSndDepGenM (mapDepGenM fileComponents dirContents)
|
exts <- unzipSndDepGenM (mapDepGenM fileComponents dirContents)
|
||||||
areImageFilenames <- mapDepGenM isImageExtension exts
|
areImageFilenames <- mapDepGenM isImageExtension exts
|
||||||
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
||||||
imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames
|
imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames
|
||||||
imagePathsOut <- mapDepGenM (curry joinPaths outputDir) imageFilenames
|
imagePathsOut <- mapDepGenM (curry joinPaths recipeDirOut) imageFilenames
|
||||||
mapDepGenM_ copyFile' (ZipToken (imagePaths, imagePathsOut))
|
mapDepGenM_ copyFile' (ZipToken (imagePaths, imagePathsOut))
|
||||||
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath outputDir) imageFilenames
|
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath recipeDirOut) imageFilenames
|
||||||
mapDepGenM_
|
mapDepGenM_
|
||||||
(\files -> convertImage (files, inject $ ResizeToWidth 800))
|
(\files -> convertImage (files, inject $ ResizeToWidth 800))
|
||||||
(ZipToken (imagePaths, thumbnailImagePaths))
|
(ZipToken (imagePaths, thumbnailImagePaths))
|
||||||
recipeDirOut <- joinPaths (outputDir, dir)
|
|
||||||
makeDir recipeDirOut
|
|
||||||
htmlBody <- runPandoc (joinPaths (dir, inject "ret.md"))
|
htmlBody <- runPandoc (joinPaths (dir, inject "ret.md"))
|
||||||
html <- applyTemplate (template, htmlBody)
|
html <- applyTemplate (template, htmlBody)
|
||||||
saveFile (html, joinPaths (recipeDirOut, indexName))
|
saveFile (html, joinPaths (recipeDirOut, indexName))
|
||||||
|
|
Loading…
Reference in New Issue