news4 - RSS aggrigation system
Révision | 31b5cb717dfa55fa8c830f0cc73fa91842575337 (tree) |
---|---|
l'heure | 2012-10-26 19:54:16 |
Auteur | hylom <hylom@user...> |
Commiter | hylom |
Merge branch 'master' into live
@@ -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 | + |
@@ -59,6 +59,9 @@ s.parentNode.insertBefore(ga, s); | ||
59 | 59 | <div class="entry"> |
60 | 60 | <!-- ヘッダ --> |
61 | 61 | <div class="entry-header"> |
62 | + % if 'images' in entry and len(entry.images) > 0: | |
63 | + <img class="thumbnail" src="${entry.images[0]}"> | |
64 | + % endif | |
62 | 65 | <h3> |
63 | 66 | <a href='${entry.link}' target="_blank_">${entry.title}</a> |
64 | 67 | </h3> |
@@ -66,7 +69,9 @@ s.parentNode.insertBefore(ga, s); | ||
66 | 69 | |
67 | 70 | |
68 | 71 | <!-- 本文テキスト --> |
69 | - <div class="entry-body">${entry.body}</div> | |
72 | + <div class="entry-body"> | |
73 | + ${entry.body} | |
74 | + </div> | |
70 | 75 | |
71 | 76 | <!-- フッタ --> |
72 | 77 | <div class="entry-footer"> |
@@ -80,12 +85,6 @@ s.parentNode.insertBefore(ga, s); | ||
80 | 85 | % for tag in entry.tags: |
81 | 86 | <span>${tag} </span> |
82 | 87 | % endfor |
83 | - % if 'images' in entry: | |
84 | - <span>画像:</span> | |
85 | - % for imgurl in entry.images: | |
86 | - <span><a href="${imgurl}">*</a></span> | |
87 | - % endfor | |
88 | - % endif | |
89 | 88 | </div> |
90 | 89 | </div> |
91 | 90 | </div> |