diff options
Diffstat (limited to 'web/macros.py')
| -rw-r--r-- | web/macros.py | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/web/macros.py b/web/macros.py index fa1b87a..b108398 100644 --- a/web/macros.py +++ b/web/macros.py | |||
| @@ -89,26 +89,26 @@ def hook_preconvert_news(): | |||
| 89 | pages.append(p) | 89 | pages.append(p) | 
| 90 | 90 | ||
| 91 | def make_news_page(posts, current_index): | 91 | def make_news_page(posts, current_index): | 
| 92 | marker = '<end-of-abstract>' | 92 | marker = '<end-of-teaser>' | 
| 93 | source = list() | 93 | source = list() | 
| 94 | if current_index == 0: | 94 | if current_index == 0: | 
| 95 | title = 'News' | 95 | title = 'News' | 
| 96 | else: | 96 | else: | 
| 97 | title = 'News Page %d' % (current_index + 1) | 97 | title = 'News Page %d' % (current_index + 1) | 
| 98 | abstract = ['# ' + title] | 98 | teaser = ['# ' + title] | 
| 99 | for p in posts: | 99 | for p in posts: | 
| 100 | timestamp = time.strptime(p.date, '%Y-%m-%d') | 100 | timestamp = time.strptime(p.date, '%Y-%m-%d') | 
| 101 | date = time.strftime('%A, %B %-e, %Y', timestamp) | 101 | date = time.strftime('%A, %B %-e, %Y', timestamp) | 
| 102 | abstract.append('## %s' % p.title) | 102 | teaser.append('## %s' % p.title) | 
| 103 | abstract.append('*%s*' % date) | 103 | teaser.append('*%s*' % date) | 
| 104 | abstract.append('%s' % p.source.split(marker, 1)[0]) | 104 | teaser.append('%s' % p.source.split(marker, 1)[0]) | 
| 105 | abstract.append('<a href="%s">Read more »</a>' % p.url) | 105 | teaser.append('<a href="%s">Read more »</a>' % p.url) | 
| 106 | source.append('# %s' % p.title) | 106 | source.append('# %s' % p.title) | 
| 107 | source.append('*%s*' % date) | 107 | source.append('*%s*' % date) | 
| 108 | source.append(p.source.replace(marker, '', 1)) | 108 | source.append(p.source.replace(marker, '', 1)) | 
| 109 | p.source = '\n'.join(source) | 109 | p.source = '\n'.join(source) | 
| 110 | p['parent'] = title | 110 | p['parent'] = title | 
| 111 | return '\n'.join(abstract) + '\n\n' | 111 | return '\n'.join(teaser) + '\n\n' | 
| 112 | 112 | ||
| 113 | def make_news_footer(n_news_pages, current_index): | 113 | def make_news_footer(n_news_pages, current_index): | 
| 114 | if n_news_pages == 1: | 114 | if n_news_pages == 1: | 
