0

I'm trying add a allstuff attribute for class Site like that:

module Jekyll
class Site
    def allstuff
        return (self.posts + self.pages)
    end

    def to_liquid(attrs = ATTRIBUTES_FOR_LIQUID)
        super(attrs + %w[
            allstuff
        ])
    end
end

But when I try to used it in a .html like that

{% for p in site.allstuff %}...{% endfor %}

It isn't work

I have written puts "eeeeoooo" in allstuff function and I have seen that it is never called.

What is the problem?

I have added others liquid attributes for class Post and class Page in the same way without any problem. I don't know what is different.

santos82h
  • 452
  • 5
  • 15
  • What are you trying to do ? – David Jacquel Oct 31 '15 at 18:57
  • Add properties to a Site from a Jekyll plugin. Like that http://stackoverflow.com/questions/19320448/add-properties-to-a-page-from-a-jekyll-plugin but in `site.property` instead of `page.property` – santos82h Oct 31 '15 at 19:02

0 Answers0