put artist on page
This commit is contained in:
parent
fa1076c56e
commit
94bd16504c
1 changed files with 12 additions and 1 deletions
|
@ -28,7 +28,7 @@ make :: Bool -> Info -> Lazy.Text
|
||||||
make nsfw = toLazyText . make' nsfw
|
make nsfw = toLazyText . make' nsfw
|
||||||
|
|
||||||
make' :: Bool -> Info -> Builder
|
make' :: Bool -> Info -> Builder
|
||||||
make' nsfw (Info {date, title, tags, nsfwTags,
|
make' nsfw (Info {date, title, artist, tags, nsfwTags,
|
||||||
description, images, links}) = [b|@0
|
description, images, links}) = [b|@0
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang=en>
|
<html lang=en>
|
||||||
|
@ -37,6 +37,7 @@ make' nsfw (Info {date, title, tags, nsfwTags,
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
$titleHeader
|
$titleHeader
|
||||||
|
$artistTag
|
||||||
<h2 class=date>$formattedDate</date>
|
<h2 class=date>$formattedDate</date>
|
||||||
$buttonBar
|
$buttonBar
|
||||||
</header>
|
</header>
|
||||||
|
@ -61,6 +62,8 @@ make' nsfw (Info {date, title, tags, nsfwTags,
|
||||||
titleTag = ifJust title \t -> [b|<title>$*t</title>|]
|
titleTag = ifJust title \t -> [b|<title>$*t</title>|]
|
||||||
titleHeader = ifJust title \t -> [b|<h1>$*t</h1>|]
|
titleHeader = ifJust title \t -> [b|<h1>$*t</h1>|]
|
||||||
|
|
||||||
|
artistTag = ifJust artist makeArtist
|
||||||
|
|
||||||
formattedDate = formatDate date
|
formattedDate = formatDate date
|
||||||
|
|
||||||
buttonBar = makeButtonBar (fromMaybe path0 title) nsfw images
|
buttonBar = makeButtonBar (fromMaybe path0 title) nsfw images
|
||||||
|
@ -70,6 +73,14 @@ make' nsfw (Info {date, title, tags, nsfwTags,
|
||||||
tagsList = makeTags nsfw tags nsfwTags
|
tagsList = makeTags nsfw tags nsfwTags
|
||||||
linksList = extLinks nsfw links
|
linksList = extLinks nsfw links
|
||||||
|
|
||||||
|
makeArtist :: Artist -> Builder
|
||||||
|
makeArtist (Artist {name, url}) =
|
||||||
|
[b|<h2 class=artist>by $artistLink</h2>|]
|
||||||
|
where
|
||||||
|
artistLink = case url of
|
||||||
|
Just u -> [b|<a href="$*u">$*name</a>|]
|
||||||
|
Nothing -> [b|$*name|]
|
||||||
|
|
||||||
makeDesc :: Strict.Text -> Builder
|
makeDesc :: Strict.Text -> Builder
|
||||||
makeDesc desc = [b|@2
|
makeDesc desc = [b|@2
|
||||||
<div class=desc>
|
<div class=desc>
|
||||||
|
|
Loading…
Reference in a new issue