Template Card Filter

How, for example, to use a card filter in Liquid? I use it at Jekyll.

---
my_array: [apple, banana, orage]
my_map:
  hello: world
  foo: bar
my_string: "how does this work?"
---
{{ page.my_map | map ... }}

That's what I got lost in. It seems that I can not find any example of its use in documents or anywhere else on the Internet.

By the way, I do not know Ruby, but the source code is also not clear.

From filtering tests it looks like this: "GitHub" does not get anything:

{{ site.posts | map: 'title' | array_to_sentence_string }}

I would expect that I need to get something like:

My First Blog Post, Yet Another Post, and Third Posts
+5
source share
1 answer

I was able to do what you want:

{{ site.posts | map: 'to_liquid' | map: 'title' | array_to_sentence_string }}

Explanation:

, site.posts Post , to_liquid ( - , , ). respond_to? :title, Liquid , map nil .

+8

All Articles