make tag buttons into links

This commit is contained in:
Rhiannon Morris 2020-08-04 19:05:20 +02:00
parent dc42ede94e
commit 752dbbd1c4

View file

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