some atom fixen
This commit is contained in:
parent
227bc9cea1
commit
bf21a8a3c0
1 changed files with 12 additions and 4 deletions
|
@ -376,10 +376,18 @@
|
||||||
(date->string (time-utc->date (make-time time-utc 0 timestamp) 0)
|
(date->string (time-utc->date (make-time time-utc 0 timestamp) 0)
|
||||||
"~Y-~m-~dT~H:~M:~SZ"))
|
"~Y-~m-~dT~H:~M:~SZ"))
|
||||||
|
|
||||||
|
(define (request-relurl request)
|
||||||
|
(let ((headers (rref request 'headers)))
|
||||||
|
(let ((server (or (assoc-ref headers "Host")
|
||||||
|
(assoc-ref headers "server-ip-addr"))))
|
||||||
|
(lambda (tail)
|
||||||
|
(string-append "http://" server "/" tail)))))
|
||||||
|
|
||||||
(define (page-feed-atom request index)
|
(define (page-feed-atom request index)
|
||||||
(let ((last-modified (let ((posts (assq-ref index 'posts)))
|
(let ((last-modified (let ((posts (assq-ref index 'posts)))
|
||||||
(and (pair? posts)
|
(and (pair? posts)
|
||||||
(assq-ref (car posts) 'timestamp)))))
|
(assq-ref (car posts) 'timestamp))))
|
||||||
|
(relurl (request-relurl request)))
|
||||||
(cond
|
(cond
|
||||||
((let ((since (assoc-ref (rref request 'headers '())
|
((let ((since (assoc-ref (rref request 'headers '())
|
||||||
"If-Modified-Since")))
|
"If-Modified-Since")))
|
||||||
|
@ -413,8 +421,8 @@
|
||||||
(id ,(assq-ref post 'key))
|
(id ,(assq-ref post 'key))
|
||||||
(published ,(timestamp->atom-date
|
(published ,(timestamp->atom-date
|
||||||
(assq-ref post 'timestamp)))
|
(assq-ref post 'timestamp)))
|
||||||
(content (@ (type "xhtml")
|
(content (@ (type "xhtml"))
|
||||||
(xmlns "http://www.w3.org/1999/xhtml"))
|
(div (@ (xmlns "http://www.w3.org/1999/xhtml"))
|
||||||
(div ,(post-sxml-content post)))))
|
,(post-sxml-content post)))))
|
||||||
(take-max (assq-ref index 'posts) 10))))))))
|
(take-max (assq-ref index 'posts) 10))))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue