[website] [fix] fixes in sitemap and rss generators

This commit is contained in:
Anand Doshi
2013-05-22 15:51:47 +05:30
parent 6241012f08
commit 488a821534
3 changed files with 13 additions and 9 deletions

View File

@@ -49,9 +49,10 @@ rss_item = u"""
def generate():
"""generate rss feed"""
import webnotes, os
import os, urllib
import webnotes
from webnotes.model.doc import Document
from website.helpers.blog import get_blog_content
from webnotes.utils import escape_html
host = (os.environ.get('HTTPS') and 'https://' or 'http://') + os.environ.get('HTTP_HOST')
@@ -62,7 +63,8 @@ def generate():
order by published_on desc limit 20""", as_dict=1)
for blog in blog_list:
blog.link = host + '/' + blog.name + '.html'
blog.link = urllib.quote(host + '/' + blog.name + '.html')
blog.content = escape_html(blog.content or "")
items += rss_item % blog