是否可以在单个 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/