capybara/templates/hashtag.html.rkt

16 lines
701 B
Racket

#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)))))))