Use the site name in opengraph tags

…which involves passing around the index file to a lot more places
This commit is contained in:
Rhiannon Morris 2022-08-11 01:54:12 +02:00
parent 73cd0ca74e
commit f51ea184bb
5 changed files with 45 additions and 31 deletions

View file

@ -13,17 +13,19 @@ import System.FilePath
dependSingle :: FilePath -- ^ yaml file name (relative to data dir!)
-> FilePath -- ^ index file name
-> Info
-> FilePath -- ^ output prefix
-> FilePath -- ^ build dir
-> Bool -- ^ include nsfw?
-> Text
dependSingle yamlDir info prefix build nsfw =
toLazyText $ dependSingle' yamlDir info prefix build nsfw
dependSingle yamlDir indexFile info prefix build nsfw =
toLazyText $ dependSingle' yamlDir indexFile info prefix build nsfw
dependSingle' :: FilePath -> Info -> FilePath -> FilePath -> Bool -> Builder
dependSingle' yamlDir info prefix build nsfw =
[b|$page: $deps $$(MAKEPAGES)|]
dependSingle' :: FilePath -> FilePath -> Info -> FilePath -> FilePath -> Bool
-> Builder
dependSingle' yamlDir indexFile info prefix build nsfw =
[b|$page: $deps $indexFile $$(MAKEPAGES)|]
where
images = #all if nsfw then #images info else #sfwImages info
@ -79,24 +81,25 @@ dependGallery' (GalleryInfo {prefix, filters})
gallery = build </> prefix </> "index.html"
rss = build </> prefix </> "rss.xml"
rules = makeRules prefix filters build data_ tmp
rules = makeRules prefix indexFile filters build data_ tmp
inc d = tmp </> prefix </> takeDirectory d <.> "mk"
incFiles = unwords $ map inc files
incs = if null infos then "" else [b|include $incFiles|]
makeRules :: FilePath -- ^ prefix
-> FilePath -- ^ index file
-> GalleryFilters
-> FilePath -- ^ build dir
-> FilePath -- ^ data dir
-> FilePath -- ^ tmp dir
-> Builder
makeRules prefix filters build data_ tmp = [b|@0
makeRules prefix indexFile filters build data_ tmp = [b|@0
$buildPrefix/%/index.html: $data_/%/info.yaml $$(MAKEPAGES)
$$(call single,$data_,$prefix,$flags)
$$(call single,$data_,$prefix,$indexFile,$flags)
$tmpPrefix/%.mk: $data_/%/info.yaml $$(MAKEPAGES)
$$(call depend-single,$prefix,$build,$data_,$flags)
$$(call depend-single,$prefix,$indexFile,$build,$data_,$flags)
$buildPrefix/%: $tmp/%
$$(call copy,-l)