news4 - RSS aggrigation system
Révision | cbfaa6f56aceda7d0c1aa1c79ada4c1fb6f6c49a (tree) |
---|---|
l'heure | 2012-10-27 04:59:50 |
Auteur | hylom <hylom@hylo...> |
Commiter | hylom |
add thumnail to each stories
@@ -10,6 +10,14 @@ a { | ||
10 | 10 | margin-bottom: 1em; |
11 | 11 | } |
12 | 12 | |
13 | +.entry-header .thumbnail { | |
14 | + width: 100px; | |
15 | + float: right; | |
16 | + margin-left: 10px; | |
17 | + margin-bottom: 10px; | |
18 | + pagging: 1px; | |
19 | +} | |
20 | + | |
13 | 21 | .entry-continue { |
14 | 22 | margin-bottom: 1em; |
15 | 23 | } |
@@ -0,0 +1,15 @@ | ||
1 | +# remove images for tracking | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +import re | |
5 | + | |
6 | +re_rssad_url = re.compile(r'^http://rss.rssad.jp/') | |
7 | + | |
8 | +def entry_filter(entry): | |
9 | + if "images" in entry: | |
10 | + for i in range(len(entry["images"])): | |
11 | + if re_rssad_url.search(entry["images"][i]): | |
12 | + entry["images"].pop(i) | |
13 | + | |
14 | + return entry | |
15 | + |
@@ -46,6 +46,9 @@ | ||
46 | 46 | <div class="entry"> |
47 | 47 | <!-- ヘッダ --> |
48 | 48 | <div class="entry-header"> |
49 | + % if 'images' in entry and len(entry.images) > 0: | |
50 | + <img class="thumbnail" src="${entry.images[0]}"> | |
51 | + % endif | |
49 | 52 | <h3> |
50 | 53 | <a href='${entry.link}' target="_blank_">${entry.title}</a> |
51 | 54 | </h3> |
@@ -53,7 +56,9 @@ | ||
53 | 56 | |
54 | 57 | |
55 | 58 | <!-- 本文テキスト --> |
56 | - <div class="entry-body">${entry.body}</div> | |
59 | + <div class="entry-body"> | |
60 | + ${entry.body} | |
61 | + </div> | |
57 | 62 | |
58 | 63 | <!-- フッタ --> |
59 | 64 | <div class="entry-footer"> |
@@ -67,12 +72,6 @@ | ||
67 | 72 | % for tag in entry.tags: |
68 | 73 | <span>${tag} </span> |
69 | 74 | % endfor |
70 | - % if 'images' in entry: | |
71 | - <span>画像:</span> | |
72 | - % for imgurl in entry.images: | |
73 | - <span><a href="${imgurl}">*</a></span> | |
74 | - % endfor | |
75 | - % endif | |
76 | 75 | </div> |
77 | 76 | </div> |
78 | 77 | </div> |