Skip to content

Instantly share code, notes, and snippets.

@jamie
Created January 31, 2009 17:51
Show Gist options
  • Save jamie/55603 to your computer and use it in GitHub Desktop.
Save jamie/55603 to your computer and use it in GitHub Desktop.
Using ~ instead of = for the content catch to
preserve whitespace indentation levels (since
I'm using preformatted code blocks)
This is actual code from http://blog.tracefunc.com,
powered by Webby
---
title: Articles by Date
filter: haml
dirty: true
---
#articles
- articles = @pages.find(:all, :sort_by => "created_at", :reverse => true)
- articles = by_year(articles)
%table
- articles.keys.sort.reverse.each do |year|
- pages = articles[year]
%tr
%th= year
%th  
- pages.each do |page|
%tr
%td= Time.parse(page.created_at).strftime('%b %e')
%td= link_to page.title, page.url
---
extension: html
filter: haml
---
!!!
%html
%head
%title= ['set_trace_func', @title, @page.title].compact.join(' ~ ')
%meta{'http-equiv' => 'content-type', 'content' => 'text/html; charset=utf-8'}
= css '/css/blueprint'
/[if IE]
= css '/css/blueprint-ie'
= css '/css/master'
%link{:href => 'http://feeds.feedburner.com/set_trace_func', :rel => 'alternate', :type => 'application/atom+xml'}
= js 'http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min'
= js '/js/prettify'
= js '/js/blog'
%body
.container
#header.span-20.last
%h1
%a{:href => '/'} set_trace_func
%h2 veni, vidi, didici
#menu.span-20.last
#feedburner
%a{:href => "http://feeds.feedburner.com/set_trace_func"}
%img{:src => "http://feeds.feedburner.com/~fc/set_trace_func?bg=0099ff&fg=000000&anim=0"}
%ul
%li
%a{:href => '/archive.html'} Archive
%li
%a{:href => '/tags.html'} Tags
%li
%a{:href => '/projects.html'} Projects
%li
%a{:href => '/about.html'} About Me
#content-wrap
#content.span-18
~ @content
#footer.span-20.last
%p
© 2006-2008 <span class="author vcard"><span class="fn">Jamie Macey</span></span>
|
Original design: <a href="http://www.styleshout.com/templates/preview/CoolWater1-0/index.html">CoolWater</a> by <a href="http://www.styleshout.com/">styleshout</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment