benschwarz / bonsai

A tiny static web site generator
http://tinytree.info/
MIT License
297 stars 39 forks source link

Error "undefined method 'permalink'" #14

Closed heliostatic closed 12 years ago

heliostatic commented 14 years ago

With mustache 0.10.0 and bonsai 1.3.0, I am getting the error:

/bonsai-1.3.0/lib/bonsai/page.rb:117:in `==': undefined method `permalink' for #<Mustache::Context:0x00000102ff0128> (NoMethodError)

I tried removing all references to {{permalink}} in my templates, so I don't think it's something I'm just invoking incorrectly. The call stack is:

PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/page.rb:117:in `==': undefined method `permalink' for #<Mustache::Context:0x00000102ff0128> (NoMethodError)
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:87:in `block in fetch'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:85:in `each'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:85:in `fetch'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:67:in `[]'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:45:in `block in render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:45:in `map'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:45:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:44:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache.rb:340:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:31:in `partial'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:40:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:44:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache.rb:340:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/context.rb:31:in `partial'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:40:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache/template.rb:44:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/mustache-0.10.0/lib/mustache.rb:336:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/tilt-0.8/lib/tilt.rb:697:in `evaluate'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/tilt-0.8/lib/tilt.rb:131:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/page.rb:121:in `render'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/exporter.rb:45:in `block in write_index'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/exporter.rb:45:in `open'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/exporter.rb:45:in `write_index'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/lib/bonsai/exporter.rb:23:in `publish!'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/bin/bonsai:56:in `block (2 levels) in <top (required)>'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1302:in `call'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1302:in `block in parse_in_order'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1258:in `catch'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1258:in `parse_in_order'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1252:in `order!'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1343:in `permute!'
from PATH_TO_RUBY/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/optparse.rb:1364:in `parse!'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/gems/bonsai-1.3.0/bin/bonsai:74:in `<top (required)>'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/bin/bonsai:19:in `load'
from PATH_TO_RUBY/gems/ruby-1.9.1-p378/bin/bonsai:19:in `<main>'
benschwarz commented 14 years ago

Don't use any newer mustache than 0.6. I'm not sure what the issue is yet and I haven't had time to extract a test case (without bonsai) for Chris.

If you feel like jumping into code and extracting some variable injection through tilt, using mustache.. go for it!

heliostatic commented 14 years ago

mustache .6 is a solution that works for me.