-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
blog.html.erb
86 lines (74 loc) · 2.95 KB
/
blog.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
<% @title = _("{{site_name}} blog", :site_name => site_name) %>
<div id="left_column" class="left_column">
<h1><%=@title %></h1>
<div id="blog" class="blog">
<% @blog.posts.each do |post| %>
<div class="blog_post">
<% date = Time.zone.parse(post.data['pubDate'][0]) %>
<h2 id="<%= date.to_i %>">
<a href="<%= post.url %>">
<%=h post.title %>
</a>
</h2>
<% author =
post.data['creator'] ? post.data['creator']&.first : post.data['author']&.first %>
<% if author && date %>
<p class="subtitle">
<%= _('Posted on {{date}} by {{author}}',
date: simple_date(date),
author: author) %>
</p>
<% else %>
<p class="subtitle">
<%= _('Posted on {{date}}', date: simple_date(date)) %>
</p>
<% end %>
<div>
<% if post.data['encoded'] %>
<%= sanitize(raw post.data['encoded'][0]) %>
<% elsif post.data['description'] %>
<%= sanitize(raw post.data['description'][0]) %>
<% end %>
</div>
<p>
<em>
<% if post.data['comments'] %>
<a href="<%=post.data['comments'][0]%>"><%= n_(
"{{number_of_comments}} comment",
"{{number_of_comments}} comments",
post.data['comments'][1],
:number_of_comments=>post.data['comments'][1]) %></a>
<% end %>
</em>
</p>
</div>
<% end %>
</div>
</div>
<div id="right_column" class="right_column" role="complementary">
<h2><%= _("Stay up to date") %></h2>
<% if !@twitter_user.empty? %>
<div class="act_link">
<i class="act-link-icon act-link-icon--twitter"></i>
<a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on X") %></a>
</div>
<% end %>
<% if !@facebook_user.empty? %>
<div class="act_link">
<i class="act-link-icon act-link-icon--facebook"></i>
<a href="https://facebook.com/<%= @facebook_user %>"><%= _("Follow us on Facebook") %></a>
</div>
<% end %>
<div class="act_link">
<i class="act-link-icon act-link-icon--rss"></i>
<a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
</div>
<% if !@twitter_user.empty? %>
<% if AlaveteliConfiguration::twitter_widget_id %>
<div id="twitter" class="twitter">
<a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<% end %>
<% end %>
</div>