Compare commits

...

4 commits

2 changed files with 12 additions and 10 deletions

View file

@ -77,13 +77,14 @@ include $(TMPDIR)/index.mk
endif
.PHONY: clean distclean
clean:
.PHONY: clean mostlyclean distclean
mostlyclean:
echo "[clean $(BUILDDIR)]"
rm -rf $(BUILDDIR)
distclean: clean
clean: mostlyclean
echo "[clean $(TMPDIR)]"
rm -rf $(TMPDIR)
distclean: clean
echo "[cabal clean]"
cabal --verbose=0 v2-clean

View file

@ -47,16 +47,17 @@ make' root ginfo@(GalleryInfo {title, desc, prefix}) output infos = [b|@0
Just o -> [b|<atom:link href="$link/$o" rel="self" />|]
makeItem :: Strict.Text -> FilePath -> Bool -> FilePath -> Info -> Builder
makeItem root prefix nsfw path i@(Info {title, date, artist}) = [b|@4
makeItem root prefix nsfw path i@(Info {title, artist}) = [b|@4
<item>
<title>$title</title>
<title>$title$up</title>
<link>$link</link>
<guid>$link</guid>
$descArtist'
<pubDate>$date'</pubDate>
<pubDate>$date</pubDate>
</item>
|]
where
up = if #updated i nsfw then [b| (updated)|] else ""
dir = takeDirectory path
link = [b|$root/$prefix/$dir|]
artist' = ifJust artist \case
@ -67,18 +68,18 @@ makeItem root prefix nsfw path i@(Info {title, date, artist}) = [b|@4
descArtist' = if #exists desc || isJust artist then [b|@6
<description>
<![CDATA[
$10.desc'
$10.artist'
$10.desc'
]]>
</description>
|]
else ""
date' = formatRSS date
date = formatRSS $ #latestDate i nsfw
makeDesc :: Desc -> Builder
makeDesc NoDesc = ""
makeDesc (TextDesc txt) = [b|$txt|]
makeDesc (LongDesc fs) = [b|$fields|]
makeDesc (LongDesc fs) = [b|<dl>$fields</dl>|]
where
fields = map makeField fs
makeField (DescField {name, text}) = [b|<b>$name</b>: $text|]
makeField (DescField {name, text}) = [b|<dt>$name <dd>$text|]