Last change
on this file since 20447 was
20447,
checked in by Moritz Heidkamp, 11 years ago
|
gazette: use new extended default-page-vars functionality to set the issues' layouts
|
File size:
868 bytes
|
Rev | Line | |
---|
[19902] | 1 | (use hyde hyde-atom environments) |
---|
| 2 | |
---|
[20447] | 3 | (default-page-vars '(((: bos "issues/" (+ any) ".wiki") |
---|
| 4 | (layouts "article.sxml" "default.sxml")))) |
---|
| 5 | |
---|
[19902] | 6 | (define $ (environment-ref (page-eval-env) '$)) |
---|
| 7 | |
---|
| 8 | (define (page-updated page) |
---|
| 9 | (or ($ 'updated page) ($ 'date page))) |
---|
| 10 | |
---|
| 11 | (define (sort-by pages accessor) |
---|
| 12 | (sort pages (lambda (p1 p2) (> (accessor p1) (accessor p2))))) |
---|
| 13 | |
---|
| 14 | (define (pages-matching regex) |
---|
| 15 | (map cdr (filter (lambda (p) (string-match regex (car p))) |
---|
| 16 | (environment-ref (page-eval-env) 'pages)))) |
---|
| 17 | |
---|
[20060] | 18 | (define (format-seconds seconds) |
---|
[20065] | 19 | (time->string (seconds->utc-time seconds) "%Y-%m-%d %z")) |
---|
[20060] | 20 | |
---|
[19902] | 21 | (for-each (lambda (binding) |
---|
| 22 | (apply environment-extend! (cons (page-eval-env) binding))) |
---|
| 23 | `((page-updated ,page-updated) |
---|
[20060] | 24 | (format-seconds ,format-seconds) |
---|
[20061] | 25 | (all-issues ,(lambda () |
---|
| 26 | (sort-by (pages-matching "issues/.+") page-updated))))) |
---|
Note: See
TracBrowser
for help on using the repository browser.