Skip to content

Instantly share code, notes, and snippets.

@kisoku
Created September 2, 2009 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kisoku/179633 to your computer and use it in GitHub Desktop.
Save kisoku/179633 to your computer and use it in GitHub Desktop.
- t = Time.parse(item[:created_at])
.article
.side
.date
.day
#{t.strftime("%d")}
.month_year
#{t.strftime("%b %y")}
.body
.title
%h2
= "#{item[:title]}" if item[:title]
~ yield
!!!
%html{ "xml:lang" => "en", :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
%head
%title
kisoku.net :: learning to breathe
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
%meta{ :name => "description", :content => "Learning to breathe" }
%link{ :rel => "alternate", :type => "application/atom xml", :title => "Learning to Breathe", :href => "http://kisoku.net/feed/atom.xml"}
%link{ :rel => "stylesheet", :type => "text/css", :href => "/css/screen.css"}
%body
.container
.header
%h1
%a{ :href => "/" }
KISOKU
%em
Learning to breathe
.nav
%ul
%li
%a{ :href => "/" }
blog
%li
%a{ :href => "/about.html" }
about
%li
%a{ :href => "http://github.com/kisoku" }
code
%li
%a{ :href => "http://kisoku.net/feed/atom.xml" }
feed
.content
~ yield
.footer
# All files in the 'lib' directory will be loaded
# before nanoc starts compiling.
require 'lorem'
require 'time'
include Nanoc3::Helpers::Blogging
include Nanoc3::Helpers::Rendering
= render 'article'
%p
= Lorem::Base.new('paragraphs', 1).output
%p
= Lorem::Base.new('paragraphs', 1).output
---
kind: article
title: Lorem Ipsum
created_at: "2009-08-24T15:39:29+09:00"
#!/usr/bin/env ruby
compile '/feed/*' do
filter :erb
end
compile '*' do
filter :haml
layout 'default'
end
route '/feed/atom/' do
'/feed/atom.xml'
end
route '/' do
item.identifier + "index.html"
end
route '/*' do
item.identifier.chop + '.html'
end
layout '*', :haml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment