Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# «=» | ||
# ^ | ||
# $ «« ^¨^ »» $ | ||
# '' '' | ||
# . | ||
# «=» | ||
# ^ | ||
# «« ^¨^ »» | ||
# LAYDOWN | ||
# ''|'|'' | ||
# | | |> | ||
# | | ______|_ | ||
# | | | oo | | ||
#'''''''''''''''''''''''''''''****** | ||
|
||
# $ gem install laydown | ||
|
||
Laydown is a simple template language for defining quick HTML5 layouts in Ruby. Never write the same old boilerplate again. | ||
|
||
require 'laydown' | ||
|
||
layout = Laydown.new do |_| | ||
_.charset 'some crazy charset' | ||
_.title 'A man in a cave' | ||
_.description 'A man is sitting in a cave.' | ||
_.keywords 'man, cave, mystery', @keywords | ||
_.favicon '/maninacave.png' | ||
_.css '/maninacave/style.css' | ||
_.css @css, '/site.css' | ||
_.js @js | ||
_.inline_js 'alert("Grrr");' | ||
_.head '<meta generator="FlushFlox Super Deluxe">' | ||
_.ga_code 'UA-8079526-5' # google analytics | ||
_.body_class @body_class | ||
end | ||
|
||
@css = 'somesheet.css' | ||
@body_class = 'front' | ||
|
||
layout.render(self) { '<p>this comes in the body</p>' } | ||
# => your html5 layout | ||
|
||
The block given to `Laydown.new` will be evaluated in the context passed to the `render` method. | ||
|