ADDED index.html.pp Index: index.html.pp ================================================================== --- index.html.pp +++ index.html.pp @@ -0,0 +1,95 @@ +#lang pollen + +◊(require pollen/template db/base racket/list racket/match) + +◊(define (fetch-series) + (define q "SELECT noun_plural, pagenode, title FROM series ORDER BY noun_plural DESC") + (query-rows (sqltools:dbc) q)) + +◊(define (series-item->txpr s) + (match-define (list n pagenode title) s) + `(li (a [[href ,pagenode]] (i ,title)))) + +◊(define (series-grouped-list) + ;; Produces '((("noun1" "p.html" "Title") ("noun1" "q.html" "Title")) (("noun2" ...) ...)) + (define init-group + (group-by first (map vector->list (fetch-series)) string-ci=?)) + + (define series-list-items + (for/list ([group (in-list init-group)]) + `(div (h2 ,(first (first group))) (ul ,@(map series-item->txpr group))))) + `(section [[class "series-list"] [style "margin-top: 1.3rem"]] ,@series-list-items)) + + + + +◊html$-page-head["The Local Yarn" #f] + + + +
+