-
Notifications
You must be signed in to change notification settings - Fork 11
/
planet.starter.html.erb
135 lines (97 loc) · 2.56 KB
/
planet.starter.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='generator' content='<%= Pluto.generator %>'>
<title><%= site.title %></title>
<%= stylesheet_link_tag 'css/planet.starter' %>
</head>
<body>
<div id='navwrap'>
<div id='nav'>
<p>
Last Update
</p>
<p class='small'>
<% if site.fetched %>
<%= site.fetched.strftime('%A, %d. %B %Y %H:%M') %>
<% end %>
</p>
<p>Subscriptions</p>
<ul class='subscriptions small' >
<% site.feeds.each do |feed| %>
<li>
<%= link_to( image_tag('i/feed-icon-10x10.png'), feed.feed_url ) %>
<%= link_to feed.title, feed.url %>
</li>
<% end %>
</ul>
<p>Meta</p>
<p class='small'>Powered by <a href='https://github.com/feedreader'>Pluto</a>;
Questions? Comments?
Send them along to the <a href='http://groups.google.com/group/wwwmake'>forum/mailing list</a>. Thanks!
</p>
</div>
</div>
<h1><%= site.title %></h1>
<!-- 1) list headlines w/ inline links -->
<div class='contents'>
<p><b>Contents</b></p>
<ol>
<% site.items.latest.limit(17).each_with_index do |item,index| %>
<li>
<%= link_to item.title, '#'+"#{index+1}" %>
<span class='item-feed-title'>
• <%= link_to item.feed.title, item.feed.url %>
</span>
<span class='item-updated'>
• <%= time_ago_in_words( item.updated ) %>
</span>
</li>
<% end %><!-- each item -->
</ol>
</div>
<!-- 2) list full articles -->
<%
items = site.items.latest.limit(17)
index = 0
ItemCursor.new( items ).each do |item, new_date, new_feed|
index += 1
%>
<% if new_date %>
<h2 class='new-date'>
<%= item.updated.strftime('%A, %d. %B %Y') %>
</h2>
<% else %>
<hr class='item-seperator'>
<% end %>
<article class='item' id='<%= "#{index}" %>'>
<% if new_feed %>
<h4 class='feed-title'>
<%= link_to item.feed.title, item.feed.url %>
</h4>
<% end %>
<h3 class='item-title'>
<%= link_to item.title, item.url %>
</h3>
<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 class='item-footer'>
<%= item.updated.strftime('%H:%M') %> •
<%= time_ago_in_words( item.updated ) %>
</div>
</div><!-- item-body -->
</article><!-- item -->
<% end %><!-- each item -->
</body>
</html>