Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 96a419b

Browse files
committed
use nested layouts for rendering changes blog
1 parent 07efa2a commit 96a419b

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

Rules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ end
1616
compile '/CNAME/' do
1717
end
1818

19+
compile '/changes/*/' do
20+
filter :erb
21+
filter :kramdown
22+
filter :colorize_syntax,
23+
:colorizers => {:javascript => :pygmentsrb}
24+
layout 'changes'
25+
layout 'default'
26+
end
27+
1928
compile '*' do
2029
filter :erb
2130
filter :kramdown

content/changes/2012-9-5-watcher-api.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
kind: article
33
title: Upcoming Changes to Watcher and Star APIs
44
created_at: 2012-9-5
5-
author: technoweenie
5+
author_name: technoweenie
66
---
77

8-
<%= render '_meta', :item => @item %>
9-
108
We recently [changed the Watcher behavior][change-watching] on GitHub. What
119
used to be known as "Watching", is now "Starring". Starring is basically
1210
a way to bookmark interesting repositories. Watching is a way to indicate that

content/changes/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<% sorted_articles.each do |article| %>
66
<div class="article" id="article<%= article.path %>">
7-
<%= render '_title', :item => article, :level => :h2 %>
7+
<%= render '_meta', :item => article, :level => :h2 %>
88
<%= article.compiled_content %>
99
</div>
1010
<% end %>

layouts/_meta.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
<<%= @level %>>
2+
<a href="<%= @item.path %>"><%= @item[:title] %></a>
3+
</<%= @level %>>
4+
15
<div class="meta">
26
<div class="who_when">
3-
<%= gravatar_for(@item[:author]) %>
7+
<%= gravatar_for(@item[:author_name]) %>
48
<span class="author vcard fn">
5-
<a href="https://github.com/<%= @item[:author] %>"><%= @item[:author] %></a>
9+
<a href="https://github.com/<%= @item[:author_name] %>"><%= @item[:author_name] %></a>
610
</span>
711
<span class="published">
812
<%= post_date @item %>

layouts/_title.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

layouts/changes.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<%= render '_meta', :item => @item, :level => :h1 %>
2+
3+
<%= yield %>

layouts/default.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
<div id="wrapper">
3333
<div class="content">
34-
<%= render '_title', :item => @item, :level => :h1 if @item[:kind] == 'article' %>
3534
<%= yield %>
3635
</div>
3736

0 commit comments

Comments
 (0)