nanoc @ arrrrcamp (2009-05-08)

Post on 13-Jul-2015

504 views 1 download

Tags:

Transcript of nanoc @ arrrrcamp (2009-05-08)

nanoc

static sitecompiler

fast

EXTREME CACHING

safe

versionable

deploywithout worries

example

% nanoc create_site arrrrcamp

% cd arrrrcamp% nanoc compile

pages

<h1>A Brand New nanoc Site</h1>

<p>You've just created a new nanoc site. The page you are looking at right now is the home page for your site (and it's probably the only page).</p>

layouts

  <body>    <div id="main"><%= @page.content %>    </div>    <div id="sidebar">      <h2>Documentation</h2>      <ul>        ...      </ul>      <h2>Community</h2>      <ul>        ...      </ul>    </div>  </body>

page metadata

title:      "My Home Page"author:     "Denis Defreyne"created_on: 2009‐05‐08

filters

filters

haml

redcloth

bluecloth

marukuerb

sass

rainpress

rdoc

rainpressrubypants erubis

My Home Page============

Lorem ipsum…

* Foo* Bar* Baz

<h1>My Home Page</h1>

<p>Lorem ipsum…</p>

<ul>  <li>Foo</li>  <li>Bar</li>  <li>Baz</li></ul>

class Rainpress < Nanoc::Filter

  identifier :rainpress

  def run(content)    ::Rainpress.compress(content)  end

end

helpers

<%= link_to(  'A random page written by me'  @pages.find { |p| p.author == 'Denis' }) %>

demo

real sites

you can hazquestions?

nanoc.stoneship.orgfreenode #nanoc

or google “nanoc”