Skip to content

Commit e924602

Browse files
committed
Add recent headlines to blog feed and posts
1 parent 58d0752 commit e924602

3 files changed

Lines changed: 65 additions & 25 deletions

File tree

layouts/blog.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
<body class="blog">
44
<%= render 'header' %>
55

6-
<div class="wrapper blog">
6+
<div id="wrapper">
77
<div class="content">
88
<%= yield %>
99
</div>
10+
11+
<div class="sidebar-shell">
12+
<%= render 'headlines', :changes => api_changes %>
13+
14+
<div class="sidebar-module notice"><a class="rss-subscribe" href="/changes.atom">Subscribe to the RSS feed</a></div>
15+
</div>
1016
</div>
1117

12-
<div class="wrapper rss-container"><a class="rss-subscribe button-secondary" href="/changes.atom">Subscribe to the RSS feed</a></div>
13-
1418
<%= render 'footer' %>
1519
</body>
1620
</html>

layouts/headlines.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h2>Recent Posts</h2>
2+
<ul class="headlines sidebar-module">
3+
<% @changes.first(8).each do |article| %>
4+
<li><a href="<%= article.path %>"><%= article[:title] %><br /><span class="date"><%= post_date article %></span></a></li>
5+
<% end %>
6+
</ul>

static/shared/css/documentation.css

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,19 @@ body.api .content h2 {
114114
font-weight: 300;
115115
}
116116

117-
.change h2 {
117+
.change h2, .sidebar-shell h2 {
118118
font-weight: 300;
119119
font-size: 22px;
120-
margin: 1.5em 0 1em;
120+
margin: 1.2em 0 1em;
121121
}
122122

123123
.change h2.title {
124124
background: none;
125125
line-height: 1.4em;
126-
margin: 2em 0 0px;
126+
margin: 1.2em 0 0px;
127127
padding-left: 0;
128-
font-size:36px;
128+
font-size: 30px;
129129
font-weight: 300;
130-
text-align: center;
131130
}
132131

133132
h2 span.step {
@@ -218,15 +217,18 @@ a img {
218217
background-color: #7e909e;
219218
}
220219

221-
.rss-container {
222-
text-align: center;
220+
.rss-subscribe {
221+
display: block;
222+
padding: 15px 14px 16px 47px;
223+
background: url(/images/feed-icon.png) 10px center no-repeat;
224+
color: #333;
225+
font-size: 14px;
226+
text-decoration: none;
223227
}
224228

225-
.rss-subscribe {
226-
display: inline-block;
227-
margin-bottom: 100px;
228-
padding: 14px 14px 14px 47px;
229-
background: url(/images/feed-icon.png) 10px center no-repeat #738797;
229+
.rss-subscribe:hover {
230+
background-color: #f4f4f7;
231+
text-decoration: none;
230232
}
231233

232234
/*------------------------------------------------------------------------------
@@ -498,34 +500,57 @@ a img {
498500
.sidebar-module.notice {
499501
background: #fafafb;
500502
border: 1px solid #CACACA;
501-
padding: 12px;
502503
border-radius: 4px;
503504
line-height: 1.5em;
504505
}
505506

506507
.sidebar-module.notice p {
508+
padding: 12px;
507509
margin: 0;
508510
}
509511

510512
.sidebar-module li {
511513
list-style-type: none;
512514
}
513515

514-
.sidebar-module ul li:last-child h3 {
516+
.sidebar-module ul li:last-child h3, .headlines li:last-child {
515517
border-bottom: none;
516518
}
517519

518520
.sidebar-module ul li:last-child ul li:first-child {
519521
border-top: 1px solid #eee;
520522
}
521523

522-
.sidebar-module ul h3 {
524+
.sidebar-module ul h3, .headlines li {
523525
margin: 0px;
524526
color: #666;
525527
border-bottom: 1px solid #eee;
526528
font-size: 14px;
527529
}
528530

531+
.headlines li a {
532+
color: #555;
533+
display: block;
534+
padding: 10px 10px;
535+
text-decoration: none;
536+
font-weight: bold;
537+
-webkit-backface-visibility: hidden;
538+
}
539+
540+
.headlines a .date {
541+
font-weight: normal;
542+
font-size: 12px;
543+
color: #777;
544+
}
545+
546+
.headlines li a:hover {
547+
color: #333;
548+
}
549+
550+
.headlines li:hover {
551+
background-color: #fdfdfd;
552+
}
553+
529554
.sidebar-module h3 a,
530555
.sidebar-module h3.disable span {
531556
padding-top: 8px;
@@ -577,6 +602,11 @@ div.sidebar-module li.disable a {
577602
color: #777;
578603
}
579604

605+
.sidebar-module ul ul li a:hover {
606+
background-color: #f2f2f2;
607+
color: #444;
608+
}
609+
580610
div.sidebar-module ul ul li span {
581611
padding-left: 20px;
582612
cursor: default;
@@ -729,9 +759,6 @@ div.sidebar-module ul ul li span {
729759
}
730760

731761
.blog .content {
732-
width: 690px;
733-
font-size: 16px;
734-
line-height: 1.6em;
735762
margin-bottom: 60px;
736763
}
737764

@@ -807,20 +834,23 @@ p code {
807834
}
808835

809836
.change {
810-
padding-bottom: 1em;
837+
padding-bottom: 40px;
811838
}
812839

813840

814841
.change .meta {
815-
font-size: 14px;
816-
text-align: center;
817-
margin-bottom: 30px;
842+
font-size: 13px;
843+
margin: 3px 0 20px;
818844
}
819845

820846
.change .meta ul {
821847
margin: 0;
822848
}
823849

850+
.change .meta ul img {
851+
margin: 0;
852+
}
853+
824854
.who_when a {
825855
padding-left: 6px;
826856
color: #999;

0 commit comments

Comments
 (0)