summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Andy Wingo2008-02-27 22:30:48 +0100
committerGravatar Andy Wingo2008-02-27 22:30:48 +0100
commitbf21a8a3c04c2b2f57244ebd5a3dd33111d08dea (patch)
tree5a85345fe5a8ed57a8784319ef7c35f9e7c21ddc
parent227bc9cea1984b89b848b1b2a244695a12189f9e (diff)
downloadtekuti-bf21a8a3c04c2b2f57244ebd5a3dd33111d08dea.tar.gz
tekuti-bf21a8a3c04c2b2f57244ebd5a3dd33111d08dea.zip
some atom fixen
-rw-r--r--tekuti/page.scm16
1 files changed, 12 insertions, 4 deletions
diff --git a/tekuti/page.scm b/tekuti/page.scm
index ee780ec..ab4871a 100644
--- a/tekuti/page.scm
+++ b/tekuti/page.scm
@@ -376,10 +376,18 @@
(date->string (time-utc->date (make-time time-utc 0 timestamp) 0)
"~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)
(let ((last-modified (let ((posts (assq-ref index 'posts)))
(and (pair? posts)
- (assq-ref (car posts) 'timestamp)))))
+ (assq-ref (car posts) 'timestamp))))
+ (relurl (request-relurl request)))
(cond
((let ((since (assoc-ref (rref request 'headers '())
"If-Modified-Since")))
@@ -413,8 +421,8 @@
(id ,(assq-ref post 'key))
(published ,(timestamp->atom-date
(assq-ref post 'timestamp)))
- (content (@ (type "xhtml")
- (xmlns "http://www.w3.org/1999/xhtml"))
- (div ,(post-sxml-content post)))))
+ (content (@ (type "xhtml"))
+ (div (@ (xmlns "http://www.w3.org/1999/xhtml"))
+ ,(post-sxml-content post)))))
(take-max (assq-ref index 'posts) 10))))))))