Last change
on this file since 20060 was
20060,
checked in by Moritz Heidkamp, 10 years ago
|
gazette: add permalink to all issues, unlink title, remove title.sxml layout and add rudimentary archive page
|
File size:
833 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 | (define (format-seconds seconds) |
---|
16 | (time->string (seconds->utc-time seconds) "%Y-%m-%d %Z")) |
---|
17 | |
---|
18 | (for-each (lambda (binding) |
---|
19 | (apply environment-extend! (cons (page-eval-env) binding))) |
---|
20 | `((page-updated ,page-updated) |
---|
21 | (format-seconds ,format-seconds) |
---|
22 | (all-issues ,(let ((issues #f)) |
---|
23 | (lambda () |
---|
24 | (or issues |
---|
25 | (begin |
---|
26 | (set! issues (sort-by (pages-matching "issues/.+") page-updated)) |
---|
27 | issues))))))) |
---|
Note: See
TracBrowser
for help on using the repository browser.