forked from renard/o-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog_rss.html
27 lines (25 loc) · 1.22 KB
/
blog_rss.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><lisp>(ob:get 'title BLOG)</lisp></title>
<link href="<lisp>(ob:get 'url BLOG)</lisp>index.xml" rel="self" />
<link href="<lisp>(ob:get 'url BLOG)</lisp>"/>
<updated><lisp>(ob:format-date (ob:get 'date (car (ob:get-posts nil 1))))</lisp></updated>
<id><lisp>(ob:get 'url BLOG)</lisp>index.xml</id>
<lisp>
(loop for p in (ob:get-posts nil 10)
do (progn
(insert "<entry>"
(format "<title type=\"html\">%s</title>" (ob:get 'title p))
(format "<author><name>%s</name></author>" (ob:get 'author p))
(format "<link href=\"%s/%s\"/>" (ob:get 'url BLOG) (ob:get 'htmlfile p))
(format "<updated>%s</updated>" (ob:format-date (ob:get 'timestamp p)))
(format "<published>%s</published>" (ob:format-date (ob:get 'timestamp p)))
(format "<id>%s</id>" (ob:get 'htmlfile p)))
(loop for tag in (ob:get 'tags p)
do (insert (format "<category scheme=\"/tags/%s.html\" term=\"%s\" label=\"%s\"/>"
(ob:get 'safe tag) (ob:get-name tag) (ob:get-name tag))))
(insert
(format "<content type=\"html\">%s</content>" (htmlize-protect-string(ob:get 'html p)))
"</entry>")))
</lisp>
</feed>