Jekyll - 在单个包含中包含多个参数?

标签 jekyll

是否可以在单个 include 中包含多个参数?

单例:

{% include card.html class=include.class1 %}

多个??

{% include card.html class=include.class1 && include.class2 %}

还是我必须做 class1=include.class1 class2=include.class2?

最佳答案

多个include参数可以用空格分隔传递 param1=value1 param2=value2,e.g.:

{% include image.html url="http://jekyllrb.com"
max-width="200px" file="logo.png" alt="Jekyll logo"
caption="This is the Jekyll logo." %} 

然后您可以在内部访问它们,在包含文件中加上include.前缀,例如:

{{include.file}} {{include.caption}}

关于Jekyll - 在单个包含中包含多个参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44233881/

相关文章:

html - 使用 Jekyll 生成一个 app.cache

tags - Jekyll 和 Liquid - 按相等标签数量 >= 2 显示相关帖子

jekyll - 如何为网站@github 页面设置不同于 utf-8 的字符集?

arrays - 如何访问 Jekyll 数组中的对象?

jekyll - Liquid 标签中的通配符匹配吗?

css - 如何在 Jekyll 帖子中写 RTL 文本?

markdown - Jekyll,最小值 : Using markdown for the homepage

ruby - SASS 和 Jekyll 集成

jekyll - 管理文件夹中的 Jekyll 页面(在 github-pages 上)

github - 如何使用 Jekyll 网站设置 RSS 提要?