【发布时间】:2018-04-05 17:46:07
【问题描述】:
我有一些组件按钮:
{% assign class = "c-button " | append: include.class %}
{% assign type = include.type | default: "button" %}
{% assign content = include.content %}
{% if content %}
<button class="{{ class }}"
type="{{ type }}">{{ content }}</button>
{% endif %}
现在我想在一个数组中包含一个带有一些值和内容的按钮:
{% include components/button.html
type = "button"
content = site.data.contentful.spaces.links.navbar[0].item_name
class = "pretty-button"
%}
我收到此错误:
液体异常:包含标签的语法无效:type = "button" 内容 = site.data.contentful.spaces.links.navbar.[0] class= "pretty-button" 有效语法:{% include file.ext param='value' param2='值' %}
不能将数组值赋给包含变量吗?
感谢您的帮助!
【问题讨论】: