ruby - Explain structure of site.categories -
jekyll supplies site.categories
variable accessible liquid templates. in site have 2 categories 1 post each. looking @ jekyll bootstrap categories.html
know:
{% category in site.categories %} {{ category[0] }}
i know renders category's name. if do:
{% item in category %} {{ item }}
it seems category has 2 items: name , post. makes no sense me. category[0]
name
, array of posts starts @ index 1? why make sense? wonder if comes ruby somehow, don't know ruby. (since jekyll written in ruby i'm adding tag, since suspect of syntax derivative.)
how determine structure of site.categories
? don't know how debug , don't understand liquid syntax enough know why behavior makes sense.
site.categories
multi-dimensional array of categories. each category consists of it's name first element, , list of posts contained in category. posts consist of name, content, permalink , more (the same info in site.posts
entries).
Comments
Post a Comment