【发布时间】:2023-03-20 11:42:01
【问题描述】:
Liquid 中的地图过滤器到底是如何使用的?我在 Jekyll 中使用它。
---
my_array: [apple, banana, orage]
my_map:
hello: world
foo: bar
my_string: "how does this work?"
---
{{ page.my_map | map ... }}
这就是我迷路的地方。我似乎在文档或其他任何在线网站上都找不到任何关于它的使用示例。
顺便说一句,我还不知道 Ruby,所以我也不清楚source code。
从filter tests 看来,以下内容应该会产生一些东西,但在 GitHub 上,我什么也没得到:
{{ site.posts | map: 'title' | array_to_sentence_string }}
我希望我应该得到类似的东西:
My First Blog Post, Yet Another Post, and Third Posts
【问题讨论】:
标签: ruby templates github liquid jekyll