news4 - RSS aggrigation system
Revision | 37a9151e7b8c3058b2d9fde3958bc98b9a1a1931 (tree) |
---|---|
Time | 2012-10-05 05:29:59 |
Author | hylom <hylom@hylo...> |
Commiter | hylom |
add trimming filter
@@ -1,5 +1,9 @@ | ||
1 | 1 | /* gnews.css */ |
2 | 2 | |
3 | +a { | |
4 | + color: #1155CC; | |
5 | +} | |
6 | + | |
3 | 7 | .entry-header{} |
4 | 8 | .entry-body{} |
5 | 9 | .entry-continue { |
@@ -11,6 +15,7 @@ | ||
11 | 15 | |
12 | 16 | header { |
13 | 17 | border-bottom: 1px solid gray; |
18 | + margin-bottom: 10px; | |
14 | 19 | } |
15 | 20 | |
16 | 21 | .main-contents h3 { |
@@ -35,4 +40,26 @@ header { | ||
35 | 40 | .entry-header h3 { |
36 | 41 | line-height: 130%; |
37 | 42 | margin: 10px auto 1em; |
43 | + color: #11111; | |
44 | +} | |
45 | + | |
46 | +.entry-header h3 a{ | |
47 | + color: #1155CC; | |
48 | +} | |
49 | + | |
50 | +/* sidebar */ | |
51 | +.sidebar h3 { | |
52 | + margin: 0 auto; | |
53 | +} | |
54 | +.sidebar li { | |
55 | + line-height: 10px; | |
56 | + height: 20px; | |
57 | +} | |
58 | + | |
59 | +.sidebar li a { | |
60 | + padding-top:0; | |
61 | + padding-bottom:0; | |
62 | + margin-top:0; | |
63 | + margin-bottom:0; | |
64 | + line-height:120%; | |
38 | 65 | } |
\ No newline at end of file |
@@ -0,0 +1,15 @@ | ||
1 | +# filter for slashdot.jp | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +import re | |
5 | + | |
6 | +re_title = re.compile(r'\[ITmedia.*?\]') | |
7 | + | |
8 | +def entry_filter(entry): | |
9 | + # すべて読む、関連ストーリーを削除 | |
10 | + title = entry['title'] | |
11 | + title = re_title.sub('', title) | |
12 | + entry['title'] = title.strip() | |
13 | + | |
14 | + return entry | |
15 | + |
@@ -0,0 +1,15 @@ | ||
1 | +# filter for Trimming | |
2 | +# -*- coding: utf-8 -*- | |
3 | + | |
4 | +import re | |
5 | + | |
6 | +re_first_para = re.compile(r'<p>(.*?)</p>') | |
7 | + | |
8 | +def entry_filter(entry): | |
9 | + body = entry['body'] | |
10 | + m = re_first_para.search(body) | |
11 | + if m: | |
12 | + body = "<p>" + m.group(1) + "...</p>" | |
13 | + entry['body'] = body | |
14 | + return entry | |
15 | + |
@@ -15,7 +15,9 @@ | ||
15 | 15 | <div class="row"> |
16 | 16 | <div class="span12"> |
17 | 17 | <header> |
18 | - <h1><a href="${site.root}">${site.name}</a></h1> | |
18 | + <a href="${site.root}"> | |
19 | + <img src="${site.img_directory}/sfjp.png"> | |
20 | + </a> | |
19 | 21 | </header> |
20 | 22 | </div> |
21 | 23 | </div> |
@@ -24,7 +26,7 @@ | ||
24 | 26 | <div class="row"> |
25 | 27 | |
26 | 28 | <!-- 左サイドバー --> |
27 | - <div class="span2 sidebar-left"> | |
29 | + <div class="span2 sidebar sidebar-left"> | |
28 | 30 | <div class="keywords"> |
29 | 31 | <h3>キーワード:</h3> |
30 | 32 | <ul class="nav nav-pills nav-stacked"> |
@@ -96,7 +98,7 @@ | ||
96 | 98 | </div><!-- main-contents --> |
97 | 99 | |
98 | 100 | <!-- 右サイドバー --> |
99 | - <div class="span3 sidebar-right"> | |
101 | + <div class="span3 sidebar sidebar-right"> | |
100 | 102 | <div class="feed-provider"> |
101 | 103 | <h3>情報提供サイト:</h3> |
102 | 104 | <ul class="nav nav-pills nav-stacked"> |