title | kind | created_at |
---|---|---|
Testing |
post |
2011/11/17 07:29pm |
Testing.
<% sorted_posts[0..2].each do |p| %> | |
<%= p.compiled_content(:snapshot => :guts) %> | |
<% end %> |
title | kind | created_at |
---|---|---|
Testing |
post |
2011/11/17 07:29pm |
Testing.
<html> | |
... | |
<%= render 'sidebar' %> | |
<%= yield %> | |
... | |
</html> |
<article role="post"> | |
<header> | |
<a class="post-title" href="<%= @item.path %>"><%= @item[:title] %></a> | |
<div class="byline"> | |
// <a class="post-date" href="<%= @item.path %>"><%= pretty_date(@item[:created_at]) %></a> | |
</div> | |
</header> | |
<%= yield %> | |
</article> |
compile '/' do | |
filter :erb | |
layout 'default' | |
end | |
compile '*' do | |
# item[:extension] returns 'html.erb' for multi-dotted filename | |
ext = item[:extension].nil? ? nil : item[:extension].split('.').last | |
if ext == 'erb' | |
filter :erb | |
elsif ext == 'md' || ext == 'markdown' | |
filter :erb | |
filter :redcarpet | |
elsif ext == 'xml' || ext == 'html' || ext.nil? | |
filter :erb | |
else | |
raise "Filter is not configured for #{item.identifier} in Rules file." | |
end | |
unless ext == 'xml' | |
item[:kind] ||= 'post' | |
layout "_#{item[:kind]}" | |
snapshot :guts | |
layout 'default' | |
end | |
end | |
route '*' do | |
item.identifier.gsub('_','-') + 'index.html' | |
end |