You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
Found that when i add
- for post in site.categories.work
to my haml template i get error
(haml):10:in `render': undefined method `work' for #<Hash:0x1a77ff0> (NoMethodError)
from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `render'
from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `instance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/haml-2.2.2/lib/haml/engine.rb:167:in `render'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/convertible.rb:72:in `render_haml_in_context'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/convertible.rb:88:in `do_layout'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/page.rb:45:in `render'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:223:in `transform_pages'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:213:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:213:in `transform_pages'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:212:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:212:in `transform_pages'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/../lib/jekyll/site.rb:126:in `process'
from /usr/local/lib/ruby/gems/1.8/gems/henrik-jekyll-0.5.2/bin/jekyll:135
from /usr/local/bin/jekyll:19:in `load'
from /usr/local/bin/jekyll:19
But if i use liquid for this:
{% for post in site.categories.work %}
<li>{{ post.title }}</li>
{% endfor %}
It works fine. Need advice, how to correct this issue.
The text was updated successfully, but these errors were encountered:
To get the payload (site.categories etc) into Haml, I turn it into a context object with accessors: a ClosedStruct (an OpenStruct that raises on missing attributes). But it's not applied recursively. If I find time I may look at how Liquid implements this. Until then, something like
site.categories['work']
should probably work.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Found that when i add
- for post in site.categories.work
to my haml template i get error
But if i use liquid for this:
It works fine. Need advice, how to correct this issue.
The text was updated successfully, but these errors were encountered: