summaryrefslogtreecommitdiffstats
path: root/web/macros.py
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-10-14 13:27:20 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-10-14 13:27:20 (GMT)
commitd037f1fdabe8fbcc226d34c25f7e7814a56ccf26 (patch)
treebd658ba84eac054b4797f0b2dc1e3a1ec33272f6 /web/macros.py
parentda2a141ae9eb9d26a08a2c466c1cf69800e17a4d (diff)
downloadsite-d037f1fdabe8fbcc226d34c25f7e7814a56ccf26.tar.gz
web/macros.py: Handle multiple articles correctly
Don't concatenate multiple news articles.
Diffstat (limited to 'web/macros.py')
-rw-r--r--web/macros.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/web/macros.py b/web/macros.py
index 978a4e4..2cf2c33 100644
--- a/web/macros.py
+++ b/web/macros.py
@@ -6,10 +6,14 @@ plugins_release = '1.5'
6mib_release = '1.0.1' 6mib_release = '1.0.1'
7release_notes = 'news/release-%s.html' % plugins_release.replace('.', '-') 7release_notes = 'news/release-%s.html' % plugins_release.replace('.', '-')
8site_url = 'https://www.nagios-plugins.org/' 8site_url = 'https://www.nagios-plugins.org/'
9feeds = """These project news articles are also available as an [RSS 9feeds = """These project news articles are also available as an [RSS feed][rss].
10feed](rss.xml). Additional stuff is posted to [Twitter](https://twitter.com/), 10Additional stuff is posted to [Twitter][twitter], so you might want to [follow
11so you might want to [follow us 11us there][follow] as well.
12there](https://twitter.com/intent/follow?screen_name=monitorplugins) as well.""" 12
13[rss]: rss.xml
14[twitter]: https://twitter.com/
15[follow]: https://twitter.com/intent/follow?screen_name=monitorplugins
16"""
13 17
14page = { 18page = {
15 "description": "Standard monitoring plugins for Nagios and compatible monitoring solutions.", 19 "description": "Standard monitoring plugins for Nagios and compatible monitoring solutions.",
@@ -95,7 +99,6 @@ def hook_preconvert_news():
95 99
96def make_news_page(posts, current_index): 100def make_news_page(posts, current_index):
97 marker = '<end-of-teaser>' 101 marker = '<end-of-teaser>'
98 source = list()
99 if current_index == 0: 102 if current_index == 0:
100 title = 'News' 103 title = 'News'
101 teaser = ['# ' + title, feeds] 104 teaser = ['# ' + title, feeds]
@@ -103,6 +106,7 @@ def make_news_page(posts, current_index):
103 title = 'News Page %d' % (current_index + 1) 106 title = 'News Page %d' % (current_index + 1)
104 teaser = ['# ' + title] 107 teaser = ['# ' + title]
105 for p in posts: 108 for p in posts:
109 source = list()
106 timestamp = time.strptime(p.date, '%Y-%m-%d') 110 timestamp = time.strptime(p.date, '%Y-%m-%d')
107 date = time.strftime('%A, %B %-e, %Y', timestamp) 111 date = time.strftime('%A, %B %-e, %Y', timestamp)
108 teaser.append('## %s' % p.title) 112 teaser.append('## %s' % p.title)