1
0
Fork 0

fix up the atom feed

* tekuti/page-helpers.scm (atom-header): Set the xml:base to the root
  url.
  (atom-entry): Actually include a link to the post.
This commit is contained in:
Andy Wingo 2008-03-02 00:09:22 +01:00
parent c2446d0f7f
commit e9849a19cc

View file

@ -189,8 +189,7 @@
(define (relurl tail) (define (relurl tail)
(string-append "http://" server-name *public-url-base* tail)) (string-append "http://" server-name *public-url-base* tail))
`(feed `(feed
(@ (xmlns "http://www.w3.org/2005/Atom") (@ (xmlns "http://www.w3.org/2005/Atom") (xml:base ,(relurl "")))
(xml:base ,(relurl "feed/atom")))
(title (@ (type "text")) ,*title*) (title (@ (type "text")) ,*title*)
(subtitle (@ (type "text")) ,*subtitle*) (subtitle (@ (type "text")) ,*subtitle*)
(updated ,(timestamp->atom-date last-modified)) (updated ,(timestamp->atom-date last-modified))
@ -204,12 +203,14 @@
(href ,(relurl "feed/atom")))))) (href ,(relurl "feed/atom"))))))
(define (atom-entry server-name post) (define (atom-entry server-name post)
(define (relurl tail) (define (relurl . tail)
(string-append "http://" server-name *public-url-base* tail)) (apply string-append "http://" server-name *public-url-base* tail))
`(entry `(entry
(author (name ,*name*) (uri ,(relurl ""))) (author (name ,*name*) (uri ,(relurl "")))
(title (@ (type "text")) ,(post-title post)) (title (@ (type "text")) ,(post-title post))
(id ,(relurl (url:decode (post-key post)))) ;hack (id ,(relurl (url:decode (post-key post)))) ;hack -- should include archives...
(link (@ (rel "alternate") (type "text/html")
(href ,(relurl "archives/" (url:decode (post-key post))))))
(published ,(timestamp->atom-date (post-timestamp post))) (published ,(timestamp->atom-date (post-timestamp post)))
(updated ,(timestamp->atom-date (post-timestamp post))) (updated ,(timestamp->atom-date (post-timestamp post)))
(content (@ (type "xhtml")) (content (@ (type "xhtml"))