|
@@ -212,14 +212,18 @@ _RSS_ITEM = """
|
212
|
212
|
|
213
|
213
|
def hook_postconvert_rss():
|
214
|
214
|
items = []
|
215
|
|
- posts = [p for p in pages if "post" in p] # get all blog post pages
|
|
215
|
+ posts = [p for p in pages if "date" in p]
|
216
|
216
|
posts.sort(key=lambda p: p.date, reverse=True)
|
217
|
217
|
posts = posts[:10]
|
218
|
218
|
for p in posts:
|
219
|
|
- title = p.post
|
|
219
|
+ title = p.title
|
|
220
|
+ if "post" in p:
|
|
221
|
+ title = p.post
|
220
|
222
|
link = "%s/%s" % (BASE_URL, p.url)
|
221
|
223
|
desc = p.html.replace("href=\"img", "%s%s%s" % ("href=\"", BASE_URL, "/img"))
|
222
|
224
|
desc = desc.replace("src=\"img", "%s%s%s" % ("src=\"", BASE_URL, "/img"))
|
|
225
|
+ desc = desc.replace("href=\"/img", "%s%s%s" % ("href=\"", BASE_URL, "/img"))
|
|
226
|
+ desc = desc.replace("src=\"/img", "%s%s%s" % ("src=\"", BASE_URL, "/img"))
|
223
|
227
|
desc = htmlspecialchars(desc)
|
224
|
228
|
date = time.mktime(time.strptime("%s 12" % p.date, "%Y-%m-%d %H"))
|
225
|
229
|
date = email.utils.formatdate(date)
|