jamie (owner)

Revisions

gist: 55603 Download_button fork
public
Public Clone URL: git://gist.github.com/55603.git
Embed All Files: show embed
_notes #
1
2
3
4
5
6
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
archive.haml #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
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
 
layout.haml #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
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>