Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Middleman

 Middleman

An in depth introduction to the static site generator.

Florian Plank

October 17, 2013
Tweet

More Decks by Florian Plank

Other Decks in Programming

Transcript

  1. Slim Erubis Less CSS Builder Liquid RDiscount Redcarpet BlueCloth Kramdown

    Maruku RedCloth RDoc Radius Markaby Nokogiri CoffeeScript Creole (Wiki markup) WikiCloth (Wiki markup) Yajl Stylus
  2. $ middleman help middleman build [options] middleman console [options] middleman

    extension NAME [options] middleman init NAME [options] middleman server [options] middleman upgrade middleman version Need moar information? $ middleman help [COMMAND]
  3. Port number $ middleman server -p 4567 $ middleman server

    --port=4568 Environment $ middleman server -e development $ middleman server --environment=build
  4. Port number $ middleman server -p 4567 $ middleman server

    --port=4568 Environment $ middleman server -e development $ middleman server --environment=build Host $ middleman server -h 0.0.0.0 $ middleman server --host=0.0.0.0
  5. $ middleman build create build/images/middleman.png create build/images/background.png identical build/images/middleman.png identical

    build/images/background.png create build/javascripts/all.js create build/stylesheets/normalize.css create build/stylesheets/all.css create build/index.html
  6. # config.rb helpers do def title(fragment = nil, separator =

    " | ") @title ||= [current_page.data.title] @title << fragment @title.flatten .compact .reject(&:empty?) .join(separator) end end
  7. # helpers/html_helpers.rb module HtmlHelpers def title(fragment = nil, separator =

    " | ") @title ||= [current_page.data.title] @title << fragment @title.flatten .compact .reject(&:empty?) .join(separator) end end
  8. activate :i18n, :path => "/langs/:locale/" makes language versions available via

    /langs/en/index.html /langs/fi/index.html /langs/de/index.html