Compare commits
4 commits
5c2a50760a
...
e1718bb861
Author | SHA1 | Date | |
---|---|---|---|
e1718bb861 | |||
a301efa521 | |||
ca53ab5b8e | |||
585706f1c5 |
2 changed files with 12 additions and 10 deletions
7
Makefile
7
Makefile
|
@ -77,13 +77,14 @@ include $(TMPDIR)/index.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean distclean
|
.PHONY: clean mostlyclean distclean
|
||||||
clean:
|
mostlyclean:
|
||||||
echo "[clean $(BUILDDIR)]"
|
echo "[clean $(BUILDDIR)]"
|
||||||
rm -rf $(BUILDDIR)
|
rm -rf $(BUILDDIR)
|
||||||
distclean: clean
|
clean: mostlyclean
|
||||||
echo "[clean $(TMPDIR)]"
|
echo "[clean $(TMPDIR)]"
|
||||||
rm -rf $(TMPDIR)
|
rm -rf $(TMPDIR)
|
||||||
|
distclean: clean
|
||||||
echo "[cabal clean]"
|
echo "[cabal clean]"
|
||||||
cabal --verbose=0 v2-clean
|
cabal --verbose=0 v2-clean
|
||||||
|
|
||||||
|
|
|
@ -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" />|]
|
Just o -> [b|<atom:link href="$link/$o" rel="self" />|]
|
||||||
|
|
||||||
makeItem :: Strict.Text -> FilePath -> Bool -> FilePath -> Info -> Builder
|
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>
|
<item>
|
||||||
<title>$title</title>
|
<title>$title$up</title>
|
||||||
<link>$link</link>
|
<link>$link</link>
|
||||||
<guid>$link</guid>
|
<guid>$link</guid>
|
||||||
$descArtist'
|
$descArtist'
|
||||||
<pubDate>$date'</pubDate>
|
<pubDate>$date</pubDate>
|
||||||
</item>
|
</item>
|
||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
|
up = if #updated i nsfw then [b| (updated)|] else ""
|
||||||
dir = takeDirectory path
|
dir = takeDirectory path
|
||||||
link = [b|$root/$prefix/$dir|]
|
link = [b|$root/$prefix/$dir|]
|
||||||
artist' = ifJust artist \case
|
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
|
descArtist' = if #exists desc || isJust artist then [b|@6
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
$10.desc'
|
|
||||||
$10.artist'
|
$10.artist'
|
||||||
|
$10.desc'
|
||||||
]]>
|
]]>
|
||||||
</description>
|
</description>
|
||||||
|]
|
|]
|
||||||
else ""
|
else ""
|
||||||
date' = formatRSS date
|
date = formatRSS $ #latestDate i nsfw
|
||||||
|
|
||||||
makeDesc :: Desc -> Builder
|
makeDesc :: Desc -> Builder
|
||||||
makeDesc NoDesc = ""
|
makeDesc NoDesc = ""
|
||||||
makeDesc (TextDesc txt) = [b|$txt|]
|
makeDesc (TextDesc txt) = [b|$txt|]
|
||||||
makeDesc (LongDesc fs) = [b|$fields|]
|
makeDesc (LongDesc fs) = [b|<dl>$fields</dl>|]
|
||||||
where
|
where
|
||||||
fields = map makeField fs
|
fields = map makeField fs
|
||||||
makeField (DescField {name, text}) = [b|<b>$name</b>: $text|]
|
makeField (DescField {name, text}) = [b|<dt>$name <dd>$text|]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue