source: project/gazette/hyde.scm @ 19902

Last change on this file since 19902 was 19902, checked in by Moritz Heidkamp, 11 years ago

gazette: initial import

File size: 612 bytes
Line 
1(use hyde hyde-atom environments)
2
3(define $ (environment-ref (page-eval-env) '$))
4
5(define (page-updated page)
6  (or ($ 'updated page) ($ 'date page)))
7
8(define (sort-by pages accessor)
9  (sort pages (lambda (p1 p2) (> (accessor p1) (accessor p2)))))
10
11(define (pages-matching regex)
12  (map cdr (filter (lambda (p) (string-match regex (car p)))
13                   (environment-ref (page-eval-env) 'pages))))
14
15(for-each (lambda (binding)
16            (apply environment-extend! (cons (page-eval-env) binding)))
17          `((page-updated ,page-updated)
18            (all-issues ,(lambda ()
19                           (sort-by (pages-matching "issues/.+") page-updated)))))
Note: See TracBrowser for help on using the repository browser.