Make generator run
This commit is contained in:
parent
abc05a6032
commit
f6c73cf906
|
@ -24,13 +24,13 @@ makeImageHTML t = do
|
||||||
(toText thumbnail)
|
(toText thumbnail)
|
||||||
(inject "\"></a></p>"))))
|
(inject "\"></a></p>"))))
|
||||||
|
|
||||||
handleRecipeDir :: Token FilePath -> Token Template -> Token FilePath -> Token FilePath -> DepGenM ()
|
handleRecipeDir :: Token FilePath -> Token FilePath -> Token Template -> Token FilePath -> Token FilePath -> DepGenM ()
|
||||||
handleRecipeDir outputDir template indexName dir = do
|
handleRecipeDir inputDir outputDir template indexName name = do
|
||||||
recipeDirOut <- joinPaths outputDir dir
|
dir <- joinPaths inputDir name
|
||||||
|
recipeDirOut <- joinPaths outputDir name
|
||||||
makeDir recipeDirOut
|
makeDir recipeDirOut
|
||||||
dirContents <- listDirectory dir
|
dirContents <- listDirectory dir
|
||||||
areImageFilenames <- mapDepGenM hasImageExtension
|
areImageFilenames <- mapDepGenM hasImageExtension dirContents
|
||||||
$ unzipSndDepGenM $ mapDepGenM fileComponents dirContents
|
|
||||||
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
||||||
imagePaths <- mapDepGenM (joinPaths dir) imageFilenames
|
imagePaths <- mapDepGenM (joinPaths dir) imageFilenames
|
||||||
imagePathsOut <- mapDepGenM (joinPaths recipeDirOut) imageFilenames
|
imagePathsOut <- mapDepGenM (joinPaths recipeDirOut) imageFilenames
|
||||||
|
@ -56,8 +56,11 @@ generateSite = do
|
||||||
makeDir outputRecipesDir
|
makeDir outputRecipesDir
|
||||||
template <- readTemplate $ inject "template.html"
|
template <- readTemplate $ inject "template.html"
|
||||||
indexName <- inject "index.html"
|
indexName <- inject "index.html"
|
||||||
dirContents <- listDirectory recipesDir
|
dirNames <- listDirectory recipesDir
|
||||||
mapDepGenM_ (handleRecipeDir outputRecipesDir template indexName) dirContents
|
dirPaths <- mapDepGenM (joinPaths recipesDir) dirNames
|
||||||
|
dirPathsAreSubdirs <- mapDepGenM isDirectory dirPaths
|
||||||
|
dirNames' <- filterDepGenM dirPathsAreSubdirs dirNames
|
||||||
|
mapDepGenM_ (handleRecipeDir recipesDir outputRecipesDir template indexName) dirNames'
|
||||||
html <- applyTemplate template $ runPandoc $ inject "om.md"
|
html <- applyTemplate template $ runPandoc $ inject "om.md"
|
||||||
aboutDir <- joinPaths outputDir $ inject "om"
|
aboutDir <- joinPaths outputDir $ inject "om"
|
||||||
makeDir aboutDir
|
makeDir aboutDir
|
||||||
|
|
Loading…
Reference in New Issue