Eclectic Media Git archived_em.space_site / 55c3e34
Made rss feed provide its own description renderer Ariana Giroux 5 months ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
3838
3939 @app.route('/rss/feed.xml', methods=['GET'])
4040 def feed():
41 def parse_description(path):
42 with open(path) as f:
43 text = f.read()
44
45 for line in text.split('\n'):
46 if len(line) > 0 and line[0] != '#':
47 return line.strip('\n')
48
4149 context = {'items': []}
4250 for item in sort_blog():
4351 context['items'].append(
4452 {
4553 'title': item[0],
46 'link': 'https://eclecticmedia.space/blog/{}'.format(item[1]),
47 'description': item[-1],
54 'link': 'https://eclecticmedia.space/blog/{}'.format(item[2]),
55 'description': parse_description(item[-1]),
4856 }
4957 )
5058