diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2009-10-08 19:17:53 +0200 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2009-10-08 19:17:53 +0200 |
commit | a4e8b49e3d5f21d416b554d935a66d52f3cd08c0 (patch) | |
tree | 9d893c2b2668cabdb5e6b7d5a3286e6295fafe8b | |
parent | c232f324d024b01492ce7eeb5f6278b3b4d541a1 (diff) |
Add missing Atom publishing functionality.
Ignore-this: 854e1b167c18c61a8faf29bd05594180
darcs-hash:651ba98e3341e180f1a21e9c432f69280458a501
-rwxr-xr-x | journal.lisp | 17 | ||||
-rw-r--r-- | main.lisp | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/journal.lisp b/journal.lisp index 75a7afd..d8a4430 100755 --- a/journal.lisp +++ b/journal.lisp @@ -46,7 +46,7 @@ ((:edit :preview) (values "/~D/preview" post-id)) (:post-comment (values "/~D" post-id)) (:trackback (values "/~D/trackback" post-id)) - (:atom (values "/~D/atom" post-id)) + (:view-atom-entry (values "/~D/atom" post-id)) (:save (values "/~D/save" post-id)) (:moderation-page "/moderate") (:css "/../journal.css"))))) @@ -133,7 +133,7 @@ (http-send-headers "application/atom+xml; charset=UTF-8") (with-xml-output (*standard-output* :encoding "utf-8") - (show-atom-entry-xml (find-entry *post-number*) :full-content t))) + (show-atom-entry-xml (find-entry *post-number*) :full-content t :include-edit-links t))) (defun show-atom-entry-xml (journal-entry &key full-content include-edit-links) @@ -171,7 +171,7 @@ #.(restore-sql-reader-syntax-state)) -(defun show-atom-feed () +(defun show-atom-feed (&key include-edit-links) #.(locally-enable-sql-reader-syntax) (revalidate-cache-or-die "application/atom+xml; charset=UTF-8") (http-add-header "Last-Modified" (http-timestamp (compute-journal-last-modified-date))) @@ -208,6 +208,10 @@ (with-tag ("link" `(("rel" "self") ("type" "application/atom+xml") ("href" ,(link-to :view-atom-feed :absolute t))))) + (when include-edit-links + (with-tag ("link" `(("rel" "service.post") + ("type" "application/atom+xml") + ("href" ,(link-to :view-atom-entry :absolute t)))))) (let ((number 0)) (dolist (journal-entry (select 'journal-entry @@ -220,7 +224,8 @@ (> (last-modification-of journal-entry) (- (get-universal-time) (* 30 24 60 60)))) - (<= number 8))) + (<= number 8)) + :include-edit-links include-edit-links) (incf number)))))) #.(restore-sql-reader-syntax-state)) @@ -410,6 +415,10 @@ :type "application/atom+xml" :href (link-to :view-comment-feed) :title "Kompottkins weiser Kommentarfeed") + (<:link :rel "service.feed" + :type "application/atom+xml" + :href (link-to :view-atom-entry) + :title "Kompottkins Weisheiten") (<:link :rel "stylesheet" :type "text/css" :href (link-to :css)) (<:link :rel "openid.server" :href "https://meinguter.name/index.php/serve") (<:link :rel "openid.delegate" :href "https://matthias.benkard.meinguter.name")) @@ -146,7 +146,10 @@ :av-pairs `((spam_p "t"))))) (show-moderation-page))) (:view-atom-entry - (cond ((string= *method* "GET") (show-atom-entry)) + (cond ((string= *method* "GET") + (if *post-number* + (show-atom-entry) + (show-atom-feed :include-edit-links t))) ((member *method* '("POST" "PUT") :test 'equal) (with-transaction () (let* ((entry (if (string= *method* "PUT") |