"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-h2")
(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 (small
- ,(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
(src "/icon-12px.png")
(alt "subscribe to rss feed")))
"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)))))))
+ ,(post-list-table site posts)))
(define (index-page site posts)
(make-page