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] + + + + +
+

The Local Yarn

+
+ + + +◊(define front-page-body ◊root{ + +is the end of the ◊index{thread} that you can pick or pluck, the forked ribbon tracing into the bookshelf, +your own or someone else’s. ◊em{I’ve seen this before} says the voice on the other end. ¶ Everything +(almost) is ◊link[1]{arranged in time order, newest first}. There are also a few arranged into named +collections: + +◊url[1]{/blog-pg1.html} + +}) +◊(crystalize-index-entries! '|index.html| front-page-body) + +
+ ◊(->html front-page-body #:splice? #t) + ◊(->html (series-grouped-list)) +
+ + Index: makefile ================================================================== --- makefile +++ makefile @@ -18,11 +18,12 @@ # ~~~ Rules ~~ # # The order of these dependencies is important. They will be processed left to right. -web: _article_htmls.mark $(articles-html) $(series-html) blog-pg1.html keyword-index.html web-extra/martin.css +web: _article_htmls.mark $(articles-html) $(series-html) +web: index.html blog-pg1.html keyword-index.html web-extra/martin.css web: ## Rebuild all web content (not PDFs) # The file article_htmls.mark is a zero-byte file that serves only as a marker. If it is older than # any of its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are # also on the Pollen cache watchlist (see pollen.rkt) @@ -46,10 +47,13 @@ # Note that if any article is part of a series, it will touch its series .poly.pm file during its # render, triggering this rule for that series. $(series-html): %.html: %.poly.pm raco pollen render $@ # tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true + +index.html: $(core-files) $(html-deps) $(series-html) index.html.pp + raco pollen render index.html # This target will also rebuild pg2, pg3, etc. as needed blog-pg1.html: $(core-files) $(html-deps) $(articles-html) blog.rkt rm -f blog*.html racket -tm blog.rkt