diff options
Diffstat (limited to 'web/macros.py')
| -rw-r--r-- | web/macros.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web/macros.py b/web/macros.py index 309e0b4..05dcf5a 100644 --- a/web/macros.py +++ b/web/macros.py | |||
| @@ -107,14 +107,15 @@ def make_news_page(posts, current_index): | |||
| 107 | teaser = ['# ' + title] | 107 | teaser = ['# ' + title] |
| 108 | for p in posts: | 108 | for p in posts: |
| 109 | source = list() | 109 | source = list() |
| 110 | author = p.author.encode('ascii', 'xmlcharrefreplace') | ||
| 110 | timestamp = time.strptime(p.date, '%Y-%m-%d') | 111 | timestamp = time.strptime(p.date, '%Y-%m-%d') |
| 111 | date = time.strftime('%A, %B %-e, %Y', timestamp) | 112 | author_date = author + ', ' + time.strftime('%B %-e, %Y', timestamp) |
| 112 | teaser.append('## %s' % p.title) | 113 | teaser.append('## %s' % p.title) |
| 113 | teaser.append('*%s*' % date) | 114 | teaser.append('*%s*' % author_date) |
| 114 | teaser.append('%s' % p.source.split(marker, 1)[0].rstrip()) | 115 | teaser.append('%s' % p.source.split(marker, 1)[0].rstrip()) |
| 115 | teaser.append('<a href="%s">Read more »</a>' % p.url) | 116 | teaser.append('<a href="%s">Read more »</a>' % p.url) |
| 116 | source.append('# %s' % p.title) | 117 | source.append('# %s' % p.title) |
| 117 | source.append('*%s*' % date) | 118 | source.append('*%s*' % author_date) |
| 118 | source.append(p.source.replace(marker, '', 1)) | 119 | source.append(p.source.replace(marker, '', 1)) |
| 119 | p.source = '\n'.join(source) | 120 | p.source = '\n'.join(source) |
| 120 | p['parent'] = title | 121 | p['parent'] = title |
