From bd6ede1df9d5079efb5eb53439528035a3b59ee5 Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Thu, 26 Sep 2024 00:09:48 +0200 Subject: [PATCH] Use correct recipe-specific output dir --- byg/src/SiteGenerator.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/byg/src/SiteGenerator.hs b/byg/src/SiteGenerator.hs index 719f949..af364d1 100644 --- a/byg/src/SiteGenerator.hs +++ b/byg/src/SiteGenerator.hs @@ -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))