Skip to content

Commit 1ba1e3d

Browse files
committed
Merge pull request #58 from rspec/tweak_blog_index
Tweak blog index.
2 parents cbbc8f1 + 14aa58d commit 1ba1e3d

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

Diff for: source/blog/index.html.erb

+9-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
11
---
2-
pageable: true
2+
pageable: false
33
---
4-
<section class='blog_post'>
4+
<section class='blog_index'>
55
<h2>Blog</h2>
6-
<% if paginate && num_pages > 1 %>
7-
<p>Page <%= page_number %> of <%= num_pages %></p>
86

9-
<% if prev_page %>
10-
<p><%= link_to 'Previous page', prev_page.url %></p>
7+
<% page_articles.each_with_index do |article, i| %>
8+
<h3><%= link_to article.title, article.url %></h3>
9+
<p>
10+
<%= article.data.author %>
11+
<small><%= article.date.strftime('%b %e, %Y') %></small>
12+
</p>
1113
<% end %>
12-
<% end %>
13-
14-
<% page_articles.each_with_index do |article, i| %>
15-
<h3>
16-
<%= link_to article.title, article.url %> -- <%= article.data.author %>
17-
<small><%= article.date.strftime('%b %e, %Y') %></small>
18-
</h3>
19-
<!-- use article.summary(250) if you have Nokogiri available to show just
20-
the first 250 characters -->
21-
<%= article.summary(500) %>
22-
<hr>
23-
<% end %>
24-
25-
<% if paginate %>
26-
<% if next_page %>
27-
<p><%= link_to 'Next page', next_page.url %></p>
28-
<% end %>
29-
<% end %>
14+
</section>

Diff for: source/stylesheets/pages/blog.css.scss

+11
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,14 @@
6161
padding-bottom: 1em;
6262
}
6363
}
64+
65+
.blog_index {
66+
@extend .blog_post;
67+
68+
h3 {
69+
margin: 1em 0 0;
70+
}
71+
small {
72+
margin: 0;
73+
}
74+
}

0 commit comments

Comments
 (0)