• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

news4 - RSS aggrigation system


Commit MetaInfo

Revision37a9151e7b8c3058b2d9fde3958bc98b9a1a1931 (tree)
Time2012-10-05 05:29:59
Authorhylom <hylom@hylo...>
Commiterhylom

Log Message

add trimming filter

Change Summary

Incremental Difference

--- a/css/gnews.css
+++ b/css/gnews.css
@@ -1,5 +1,9 @@
11 /* gnews.css */
22
3+a {
4+ color: #1155CC;
5+}
6+
37 .entry-header{}
48 .entry-body{}
59 .entry-continue {
@@ -11,6 +15,7 @@
1115
1216 header {
1317 border-bottom: 1px solid gray;
18+ margin-bottom: 10px;
1419 }
1520
1621 .main-contents h3 {
@@ -35,4 +40,26 @@ header {
3540 .entry-header h3 {
3641 line-height: 130%;
3742 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%;
3865 }
\ No newline at end of file
--- /dev/null
+++ b/filters/itmedia.py
@@ -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+
--- /dev/null
+++ b/filters/trimming.py
@@ -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+
Binary files /dev/null and b/img/sfjp.png differ
--- a/templates/index.tmpl.html
+++ b/templates/index.tmpl.html
@@ -15,7 +15,9 @@
1515 <div class="row">
1616 <div class="span12">
1717 <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>
1921 </header>
2022 </div>
2123 </div>
@@ -24,7 +26,7 @@
2426 <div class="row">
2527
2628 <!-- 左サイドバー -->
27- <div class="span2 sidebar-left">
29+ <div class="span2 sidebar sidebar-left">
2830 <div class="keywords">
2931 <h3>キーワード:</h3>
3032 <ul class="nav nav-pills nav-stacked">
@@ -96,7 +98,7 @@
9698 </div><!-- main-contents -->
9799
98100 <!-- 右サイドバー -->
99- <div class="span3 sidebar-right">
101+ <div class="span3 sidebar sidebar-right">
100102 <div class="feed-provider">
101103 <h3>情報提供サイト:</h3>
102104 <ul class="nav nav-pills nav-stacked">