pass index file to gallery/rss

(instead of trying to escape the strings inside in make & on the command
line)
This commit is contained in:
Rhiannon Morris 2020-08-04 02:25:59 +02:00
parent 161cb48d3a
commit 28fc9db3e0
6 changed files with 63 additions and 67 deletions

View file

@ -36,25 +36,26 @@ dependSingle' yamlDir info prefix build nsfw =
thumbFile (thumbnail info) : map pageFile paths ++ paths ++ dls
dependGallery :: GalleryInfo
-> FilePath -- ^ index file
-> [(FilePath, Info)] -- ^ relative to data dir
-> FilePath -- ^ build dir
-> FilePath -- ^ data dir
-> FilePath -- ^ tmp dir
-> Text
dependGallery ginfo infos build data_ tmp =
toLazyText $ dependGallery' ginfo infos build data_ tmp
dependGallery ginfo index infos build data_ tmp =
toLazyText $ dependGallery' ginfo index infos build data_ tmp
dependGallery' :: GalleryInfo -> [(FilePath, Info)]
dependGallery' :: GalleryInfo -> FilePath -> [(FilePath, Info)]
-> FilePath -> FilePath -> FilePath -> Builder
dependGallery' (GalleryInfo {title, desc, prefix, filters})
infos' build data_ tmp = [b|@0
dependGallery' (GalleryInfo {prefix, filters})
indexFile infos' build data_ tmp = [b|@0
$@index: $@gallery
$@gallery: $@pages' $@files' $@rss $$(MAKEPAGES)
$$(call gallery,$title',$@prefix,$flags)
$@gallery: $@pages' $@files' $@rss $@indexFile $$(MAKEPAGES)
$$(call gallery,$@indexFile,$@prefix)
$@rss: $@files' $$(MAKEPAGES)
$$(call rss,$title',$desc',$@prefix,$@data_)
$@rss: $@files' $@indexFile $$(MAKEPAGES)
$$(call rss,$@indexFile,$@prefix,$@data_)
$rules
@ -80,12 +81,6 @@ dependGallery' (GalleryInfo {title, desc, prefix, filters})
incFiles = unwords $ map inc files
incs = if null infos then "" else [b|include $@incFiles|]
flags = filtersToFlags filters
title' = substComma title
desc' = substComma desc
substComma = textMap \case ',' -> "$(comma)"; c -> fromChar c
makeRules :: FilePath -- ^ prefix
-> GalleryFilters
-> FilePath -- ^ build dir