Created
November 17, 2011 20:03
-
-
Save bobthecow/1374332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# layouts/default.html.erb: | |
<html> | |
... | |
<%= yield %> | |
... | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# layouts/image.html.erb: | |
<article role="image"> | |
<%= partial(@item) %> | |
<header> | |
<% if @item[:title] %> | |
<a class="post-caption" href="<%= @item.path %>"><%= @item[:title] %></a> | |
<% end %> | |
<a class="post-date" href="<%= @item.path %>"><%= pretty_date(@item[:created_at]) %> »</a> | |
</header> | |
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# content/index.html: | |
<% sorted_posts[0..2].each do |p| %> | |
<%= p.rendered_content(:snapshot => :guts) %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# layouts/link.html.erb: | |
<article role="link"> | |
<a href="<%= @item[:link] %>" title="<%= @item[:title] %>"><%= @item[:title] %> »</a> <%= partial(@item) %> • | |
<a class="post-date" href="<%= @item.path %>"><%= pretty_date(@item[:created_at]) %></a> | |
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rules: | |
compile '*' do | |
if not item.binary? | |
if item[:kind] == 'image' | |
layout 'image' | |
else if item[:kind] == 'link' | |
layout 'link' | |
else | |
layout 'item' | |
end | |
snapshot :guts | |
layout 'default' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment