gdritter repos when-computer / 58b4ba4
Some changes for feed-related markup Getty Ritter 9 years ago
2 changed file(s) with 20 addition(s) and 3 deletion(s). Collapse all Expand all
4545 (map (lambda (file-entry)
4646 (let* ((filename (string-append "posts/" (car file-entry)))
4747 (telml (translate-file filename))
48 (metadata (telml-meta telml)))
49 (make-post filename
50 (localtime (stat:mtime (cadr file-entry)))
51 (meta-slug metadata)
52 (meta-title metadata)
53 (meta-tags metadata)
54 (telml-content telml))))
55 files-sorted)))
56
57 ;; This should be factored out better, but for now... eh...
58 (define (get-all-feed-posts)
59 (let* ((files (cddr (file-system-tree "posts")))
60 (files-sorted (sort files (lambda (x y)
61 (> (stat:mtime (cadr x))
62 (stat:mtime (cadr y)))))))
63 (map (lambda (file-entry)
64 (let* ((filename (string-append "posts/" (car file-entry)))
65 (telml (translate-feed-file filename))
4866 (metadata (telml-meta telml)))
4967 (make-post filename
5068 (localtime (stat:mtime (cadr file-entry)))
122140 (map mk-tag-page tags)))
123141
124142 (define (feed)
125 (let ((posts (get-all-posts)))
143 (let ((posts (get-all-feed-posts)))
126144 (with-output-to-file "output/feed.xml"
127145 (lambda ()
128146 (display (serialize-sxml (atom-feed posts)))))))
148148 (define feed-tag-list
149149 (append basic-tag-list
150150 (list (cons 'wd (lambda (wd _) wd))
151 (cons 'sidenote
152 (lambda (arg) (list "(" arg ")")))
151 (cons 'sidenote (lambda _ ""))
153152 (cons 'ref (lambda _ "")))))
154153
155154 (define (partition doc lst)