如何检查树枝中的多个 if 条件?这些似乎都不起作用而且它们看起来都很凌乱和沉重。
{% if pageClass != "page-home" %}
{% if bodyClass != "500" %}
{% if bodyClass != "404" %}
{% include '_components/type-bg' with {
content: {
slug: entry.slug|split(' ')|slice(0, 1)|join
},
} only %}
{% endif %}
{% endif %}
{% endif %}
我也尝试过以下
{% if (pageClass != "page-home") or (if bodyClass != "500") or (if bodyClass != "404")%}
{% include '_components/type-bg' with {
content: {
slug: entry.slug|split(' ')|slice(0, 1)|join
},
} only %}
{% endif %}