capybara/templates/hashtag.html.rkt

16 lines
701 B
Racket
Raw Normal View History

2021-06-24 04:16:14 +00:00
#lang capybara/template
(apply
append
(for*/list ([name (in-list (sort (hash-keys hashtags-map) string<? #:key string-downcase))]
[entries (in-value (hash-ref hashtags-map name))])
(list
`(h1 ([class "tag-heading"] [id ,name]) ,(format "#~a" name))
`(ul ([class "tagged-pages"])
,@(for*/list ([ref (in-list (sort (hash-keys entries) string<?
#:key (compose string-downcase path->string)))]
[name (in-value (hash-ref entries ref))])
`(li () (a ([class "tagged-page"]
[href ,(format "~a~a" base-url ref)])
,name)))))))