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.