"https://man.sr.ht/lists.sr.ht/etiquette.md") "]")
".")))
+(define* (post-uri site post #:optional prefix)
+ (string-append (or prefix "") "/"
+ (site-post-slug site post) ".html"))
+
+(define* (post-list-table site posts #:optional prefix)
+ `((table
+ (@ (class "post-list"))
+ (tbody
+ ,@(map
+ (lambda (post)
+ `(tr
+ (td ,(aa (post-ref post 'title)
+ (post-uri site post prefix)))
+ (td (small ,(date->string (post-date post)
+ my-date-format)))))
+ posts)))))
+
(define* (my-collection-template site title posts prefix
#:optional all-posts tag)
- (define (post-uri post)
- (string-append (or prefix "") "/"
- (site-post-slug site post) ".html"))
-
`((h2 ,title
,(if tag
- (aa `(img (@ (class "feed-icon")
- (src "/feed.svg")
+ (aa `(img (@ (class "feed-icon-h2")
+ (src "/icon-16px.png")
(alt "subscribe to atom feed")))
(tag-uri my-tag-prefix tag ".xml"))
'()))
- (table
- (@ (class "post-list"))
- (tbody
- ,@(map (lambda (post)
- `(tr
- (td ,(aa (post-ref post 'title) (post-uri post)))
- (td (@ (style "font-size: 0.875em;"))
- ,(date->string (post-date post)
- my-date-format))))
- posts)))
+ ,(post-list-table site posts prefix)
(h2 "Tags")
,(tag-links (or all-posts posts))
,(if tag
'(a (@ (href "/notes.html"))
- "← all posts")
+ "← all notes")
'())))
(define bandali-theme
"images"))
(h2 (@ (id "notes")) "Notes")
(p "Here are notes about a variety of topics and issues I care "
- "about. They’re also available via " ,(aa "Atom" "notes.atom")
- " and " ,(aa "RSS" "notes.rss") " feeds.")
- (table
- (@ (class "post-list"))
- (tbody
- ,@(map
- (lambda (post)
- (define (post-uri post)
- (string-append "/"
- (site-post-slug site post) ".html"))
- `(tr
- (td ,(aa (post-ref post 'title) (post-uri post)))
- (td (small
- ,(date->string (post-date post) my-date-format)))))
- (take-up-to 10 (posts/reverse-chronological posts)))))))
+ "about. They’re also available via "
+ ,(aa `((img (@ (class "feed-icon")
+ (src "/icon-12px.png")
+ (alt "subscribe to atom feed")))
+ "Atom")
+ "notes.atom")
+ " and "
+ ,(aa `((img (@ (class "feed-icon")
+ (src "/icon-12px.png")
+ (alt "subscribe to rss feed")))
+ "RSS") "notes.rss") " feeds.")
+ ,(post-list-table site posts)))
(define (index-page site posts)
(make-page