Skip to content

Commit

Permalink
Added Haml options & fixed partial options
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bartholomew committed Jan 30, 2009
1 parent 6886609 commit 8dca81a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 59 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
.DS_Store
coverage
pkg
test/sandbox/test_site/site/*
website/*.html
website/stylesheets/*.css
website/releases/
Expand Down
50 changes: 0 additions & 50 deletions README.markdown

This file was deleted.

3 changes: 2 additions & 1 deletion Rakefile
Expand Up @@ -5,6 +5,7 @@ require File.dirname(__FILE__) + '/lib/staticmatic'
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe = Hoe.new('staticmatic', StaticMatic::VERSION) do |p|
p.developer('Stephen Bartholomew', 'steve@curve21.com')
p.summary = "Lightweight Static Site Framework"
p.rubyforge_name = p.name
p.extra_deps = [
['haml','>= 2.0'],
Expand All @@ -16,7 +17,7 @@ $hoe = Hoe.new('staticmatic', StaticMatic::VERSION) do |p|

p.clean_globs |= %w[**/.DS_Store tmp *.log]
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'markdown')
p.rsync_args = '-av --delete --ignore-errors'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/staticmatic.rb
Expand Up @@ -5,7 +5,7 @@
require 'fileutils'

module StaticMatic
VERSION = '0.10.0'
VERSION = '0.10.1'
end

["render", "build", "setup", "server", "helpers", "rescue"].each do |mixin|
Expand Down
4 changes: 3 additions & 1 deletion lib/staticmatic/configuration.rb
Expand Up @@ -6,11 +6,13 @@ class Configuration

attr_accessor :use_extensions_for_page_links
attr_accessor :sass_options

attr_accessor :haml_options

def initialize
self.preview_server_port = 3000
self.use_extensions_for_page_links = true
self.sass_options = {}
self.haml_options = {}
end
end
end
4 changes: 2 additions & 2 deletions lib/staticmatic/mixins/render.rb
Expand Up @@ -93,9 +93,9 @@ def generate_css(source, source_dir = '')
# generate_html_from_template_source("content:\n= yield") { "blah" } -> "content: blah"
#
def generate_html_from_template_source(source, options = {})
html = Haml::Engine.new(source, options)
html = Haml::Engine.new(source, self.configuration.haml_options.merge(options))

html.render(@scope) { yield }
html.render(@scope, options) { yield }
end

def determine_layout(dir = '')
Expand Down
13 changes: 13 additions & 0 deletions website/src/pages/how_to_use.haml
Expand Up @@ -86,6 +86,19 @@
= link 'Sass', 'http://haml.hamptoncatlin.com/docs/sass'
can take like :style => :compact

%h3 configuration.haml_options

%p
Default is an empty hash. You can specify any options that
= link 'Haml', 'http://haml.hamptoncatlin.com/docs/haml'
can take like:

.code :attr_wrapper => '"'
%p
(have Haml use double quotes instead of single quotes for
wrapping HTML attribute values)
%h2{:id => 'templates'} Templates
%p
Expand Down
6 changes: 2 additions & 4 deletions website/src/partials/news.haml
@@ -1,5 +1,3 @@
.heading News
.title 0.10.0 Released!
%p This release brings some major improvements to error reporting as well as preparation for forthcoming improvements.

= link "And More!", "/releases/0_10_0.html"
.title 0.10.1 Released
%p Adds haml options & fixes bug with partial options

0 comments on commit 8dca81a

Please sign in to comment.