From 94bd16504c0d740757eac42fa8899ef84ac219fc Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Tue, 14 Jul 2020 06:51:46 +0200 Subject: [PATCH] put artist on page --- make-pages/SinglePage.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/make-pages/SinglePage.hs b/make-pages/SinglePage.hs index 00d84b7..3c450b2 100644 --- a/make-pages/SinglePage.hs +++ b/make-pages/SinglePage.hs @@ -28,7 +28,7 @@ make :: Bool -> Info -> Lazy.Text make nsfw = toLazyText . make' nsfw make' :: Bool -> Info -> Builder -make' nsfw (Info {date, title, tags, nsfwTags, +make' nsfw (Info {date, title, artist, tags, nsfwTags, description, images, links}) = [b|@0 @@ -37,6 +37,7 @@ make' nsfw (Info {date, title, tags, nsfwTags,
$titleHeader + $artistTag

$formattedDate $buttonBar

@@ -61,6 +62,8 @@ make' nsfw (Info {date, title, tags, nsfwTags, titleTag = ifJust title \t -> [b|$*t|] titleHeader = ifJust title \t -> [b|

$*t

|] + artistTag = ifJust artist makeArtist + formattedDate = formatDate date buttonBar = makeButtonBar (fromMaybe path0 title) nsfw images @@ -70,6 +73,14 @@ make' nsfw (Info {date, title, tags, nsfwTags, tagsList = makeTags nsfw tags nsfwTags linksList = extLinks nsfw links +makeArtist :: Artist -> Builder +makeArtist (Artist {name, url}) = + [b|

by $artistLink

|] + where + artistLink = case url of + Just u -> [b|$*name|] + Nothing -> [b|$*name|] + makeDesc :: Strict.Text -> Builder makeDesc desc = [b|@2