Created
November 28, 2014 00:28
-
-
Save ZucchiniZe/584e9aabf847e0ecae98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'haml' | |
| require 'better_errors' | |
| configure :development do | |
| use BetterErrors::Middleware | |
| BetterErrors.application_root = __dir__ | |
| end | |
| get '/' do | |
| @title = 'HAML Test' | |
| haml :index | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require './app' | |
| run Sinatra::Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source "https://rubygems.org" | |
| group :development do | |
| gem "better_errors" | |
| gem "binding_of_caller" | |
| gem "rerun" | |
| end | |
| gem "sinatra" | |
| gem "haml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %h1 Title: #{@title} | |
| %p Hello HAML! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !!! 5 | |
| %html | |
| %head | |
| %meta{ charset: 'utf-8' } | |
| %title= @title | |
| %link{ rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' } | |
| %link{ rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' } | |
| %script{ src: '//code.jquery.com/jquery-2.1.1.min.js' } | |
| :css | |
| header { border-bottom: 1px solid #eee; } | |
| main { margin-top: 25px; } | |
| %body | |
| .container | |
| %header | |
| %h1.text-muted= @title | |
| %main | |
| = yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment