-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathindex.erb
72 lines (67 loc) · 2.07 KB
/
index.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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><%= Blog.title %></title>
<link href="/main.css" rel="stylesheet" type="text/css" />
<link href="/feed" rel="alternate" title="Primary Feed" type="application/atom+xml" />
</head>
<body>
<div id="header">
<div id="logo">
<h1><a href="/"><%= Blog.title %></a></h1>
<p>by <%= Blog.author %></p>
</div>
</div>
<div id="content">
<% posts.each do |post| %>
<div class="post">
<p class="date"><%= post[:created_at].strftime("%b") %><b><%= post[:created_at].strftime("%d") %></b></p>
<h2 class="title"><a href="<%= post.url %>"><%= post[:title] %></a></h2>
<p class="meta"><small>
<%= post.linked_tags %>
<% if Blog.disqus_shortname %>
| <a href="<%= post.url %>#disqus_thread">comments</a>
<% end %>
</small></p>
<div class="entry">
<%= post.summary_html %>
<% if post.more? %>
<a href="<%= post.url %>">Continue reading »</a>
<% end %>
</div>
</div>
<% end %>
<% if posts.empty? %>
<h2><p>Looks like this is a fresh install of Scanty.</p><p><a href="/auth">Log in</a>, then <a href="/posts/new">create a post</a>.</p></h2>
<% else %>
<div id="older_posts">
<a href="/past">Archive</a>
</div>
<% end %>
<% if admin? %>
<div id="new_post"><a href="/posts/new"">New post</a></div>
<% end %>
</div>
<% if Blog.disqus_shortname %>
<script type="text/javascript">
//<[CDATA[
(function() {
var links = document.getElementsByTagName('a');
var query = '?';
for(var i = 0; i < links.length; i++) {
if(links[i].href.indexOf('#disqus_thread') >= 0) {
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
}
}
document.write('<script type="text/javascript" src="http://disqus.com/forums/<%= Blog.disqus_shortname %>/get_num_replies.js' + query + '"></' + 'script>');
})();
//]]>
</script>
<% end %>
<div id="footer">
<p id="legal">
Content by <%= Blog.author %> |
Design adapted from <a href="http://www.freecsstemplates.org/preview/replenish">Replenish</a>
</div>
</body>
</html>