Getting Started

Once you have Phlexite installed, create a build.rb file. Running this file will build your site:

require 'phlex'
require 'phlexite'

Phlexite::Site.new do |s|
  # build your site here...
end

Right now, that doesn’t do much. Let’s add a page:

# ...

class HomePage < Phlex::HTML
  def view_template
    html {
      head {
        title { "Hello, world!" }
      }
      body {
        h1 { "Hello, world!" }
      }
    }
  end
end

# ...

Phlexite::Site.new do |s|
  s.page '/index.html', HomePage.new
end

To add static assets, use s.mount:

s.mount 'assets', on: '/'

Congratulations! You’ve learned the core functionality.