-
Notifications
You must be signed in to change notification settings - Fork 0
/
zen.html.erb
149 lines (116 loc) · 3.28 KB
/
zen.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='generator' content='<%= Pluto.generator %>'>
<title><%= site.title %></title>
<%= stylesheet_link_tag 'css/zen' %>
</head>
<body>
<% site.items.latest.limit(15).each do |item| %>
<div class='item'>
<!-- todo: calc number of words -->
<!-- use number of words for
5 min read/ 12 min read etc. 1 min read -->
<div class='item-header'>
<span class='item-feed-title'>
<%= link_to item.feed.title, item.feed.url, title: "Go to »#{item.feed.title}«" %>
</span>
<span class='item-min-read'>
• 3 min read
</span>
<h2><%= link_to item.title, item.url, title: "Go to »#{item.title}«" %></h2>
</div>
<div class='item-body'>
<div class='item-content item-summary'>
<!--
note: content goes first; than try summary
-->
<% if item.content %>
<%= item.content %>
<% elsif item.summary %>
<%= item.summary %>
<% else %>
-/-
<% end %>
</div>
</div><!-- item-body -->
<div class='item-followups'>
<span class='item-followups-title'>
Further Reading
</span>
<!-- todo: add more stories from feed -->
<div class='item-followups-list'>
<!-- fix: exclude self/current story/item - how?
-->
<% item.feed.items.latest.limit(3).each do |item|
if item.summary
item_snippet_plain_text = strip_tags( item.summary )[0..60]
elsif item.content
item_snippet_plain_text = strip_tags( item.content )[0..60]
else
item_snippet_plain_text = '-/-'
end
%>
<div>
<h3 class='followup-title'>
<%= link_to item.title, item.url, title: "Go to »#{item.title}«" %>
</h3>
—
<p class='followup-desc'>
<%= item_snippet_plain_text %>
</p>
</div>
<% end %>
</div>
</div>
<div class='item-footer'>
<!-- add author; time etc. -->
<!-- use for personal blog; fix - for now always Published in
<h4>Written by</h4>
-->
<h4>Published by</h4>
<h3>
<%= link_to item.feed.title, item.feed.url, title: "Go to »#{item.feed.title}«" %>
</h3>
<p class='item-published'>
<%= item.published.strftime('%A %B %d, %Y @ %H:%M') %> •
<%= time_ago_in_words( item.published ) %>
</p>
</div>
</div><!-- item -->
<div class='item-preview'>
<!-- todo: Read next
next story
-->
<!-- fix: for now display same story again - should be, of course, next story!
use new item cursor -> will include next/prev etc.
-->
<p class='item-read-next'>
Read next
</p>
<h3><%= link_to item.title, item.url, title: "Go to »#{item.title}«" %></h3>
<!-- fix: change to 140 or more -->
<% if item.summary
item_snippet_plain_text = strip_tags( item.summary )[0..60]
elsif item.content
item_snippet_plain_text = strip_tags( item.content )[0..60]
else
item_snippet_plain_text = '-/-'
end
%>
<p class='item-desc'>
<%= item_snippet_plain_text %>
</p>
<p>
<span class='item-feed-title'>
<%= link_to item.feed.title, item.feed.url, title: "Go to »#{item.feed.title}«" %>
</span>
<span class='item-min-read'>
• 3 min read
</span>
</p>
</div><!-- item-preview -->
<% end %><!-- each item -->
</body>
</html>