make tag buttons into links

This commit is contained in:
Rhiannon Morris 2020-08-04 19:05:20 +02:00
parent dc42ede94e
commit 752dbbd1c4
1 changed files with 5 additions and 4 deletions

View File

@ -82,7 +82,7 @@ make' nsfw dir info@(Info {date, title, artist}) = [b|@0
images = imagesFor nsfw info
descSection = makeDesc $ descFor nsfw info
tagsList = makeTags $ tagsFor nsfw info
tagsList = makeTags undir $ tagsFor nsfw info
linksList = extLinks $ linksFor nsfw info
prefetches = map makePrefetch $ tail images
@ -143,8 +143,8 @@ altButton i (Image {label, path, nsfw, warning}) = [b|@4
path' = pageFile path
warning' = ifJust warning \w -> [b| data-warning="$*w"|]
makeTags :: [Strict.Text] -> Builder
makeTags tags =
makeTags :: FilePath -> [Strict.Text] -> Builder
makeTags undir tags =
if null tags then "" else [b|@4
<nav id=tags class=info-section>
<h2>tags</h2>
@ -155,7 +155,8 @@ makeTags tags =
|]
where
tagList = map makeTag tags
makeTag t = [b|<li>$*t|]
makeTag tag = [b|<li><a href="$@undir#require_$tag'">$*tag</a>|]
where tag' = escId tag
extLinks :: [Link] -> Builder
extLinks links =