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

Static Sites com o Middleman

Static Sites com o Middleman

Lightning Talk apresentado no Floripa On Rails

Gabriel Mazetto

February 24, 2016
Tweet

More Decks by Gabriel Mazetto

Other Decks in Programming

Transcript

  1. $ gem install middleman Successfully installed middleman-4.1.1 Parsing documentation for

    middleman-4.1.1 Installing ri documentation for middleman-4.1.1 Done installing documentation for middleman after 0 seconds 1 gem installed
  2. $ middleman init floripaonrails exist create .gitignore create Gemfile create

    config.rb create source/images/middleman-logo.svg create source/index.html.erb create source/javascripts/all.js create source/layouts/layout.erb create source/stylesheets/_normalize.scss create source/stylesheets/site.css.scss Do you want to use Compass? yes Do you want to use LiveReload? yes insert Gemfile insert config.rb ... run bundle install from "./floripaonrails"
  3. $ middleman help Commands: middleman build [options] middleman config [options]

    middleman console [options] middleman deploy [options] middleman extension [options] middleman help [COMMAND] middleman init TARGET [options] middleman server [options] middleman version
  4. configure :development do activate :livereload end # Build-specific configuration configure

    :build do # Minify CSS on build # activate :minify_css # Minify Javascript on build # activate :minify_javascript end activate :disqus do |d| d.shortname = 'floripaonrails' end
  5. Slim Erubis Less CSS Builder Liquid RDiscount Redcarpet BlueCloth Kramdown

    Maruku HAML RedCloth RDoc Radius Markaby Nokogiri CoffeeScript Creole (Wiki markup) WikiCloth (Wiki markup) Yajl Stylus
  6. image: ruby:2.2 variables: LANG: "C.UTF-8" pages: script: - which ruby

    - bundle install --deployment --jobs $(nproc) - bundle exec middleman build artifacts: paths: - public only: - source
  7. ... # Pretty URLs activate :directory_indexes # Build HTML files

    to 'public' folder (GitLab Pages convention) set :build_dir, 'public' ...