将变量传递到标记Jekyll

将变量传递到标记Jekyll,jekyll,liquid,Jekyll,Liquid,总之 如何将此赋值变量放入for标记中 {% assign thisslider = include.whichslider %} // returns "slider1" {% for item in thisslider %} 上下文 在我的博客网站上,我正努力做到这一点,这样我就可以通过滑块发布图片,在文章中显示。 它只适用于一个滑块,但当我需要多个滑块时,我希望能够指定包含中的哪个滑块 {%include content-slides.html whichslider=“slider1

总之

如何将此赋值变量放入for标记中

{% assign thisslider = include.whichslider %} // returns "slider1"
{% for item in thisslider %}
上下文

在我的博客网站上,我正努力做到这一点,这样我就可以通过滑块发布图片,在文章中显示。 它只适用于一个滑块,但当我需要多个滑块时,我希望能够指定包含中的哪个滑块

{%include content-slides.html whichslider=“slider1”%}

在content-slides.html中,我需要获取include参数“slider1”,并将其传递到for循环声明中,如下所示

{% assign thisslider = include.whichslider %}
    {% for item in page.thisslider %}
        <p>each slide code in here</p>
    {% endfor %}
</div>
content-slides.html

{% assign thisslider = include.whichslider %}
{% for item in page.thisslider %}
   <p>each slide code in here</p>
{% endfor %}
{%assignthislider=include.whichslider%}
{page.thislider%中项目的%s}
这里的每个幻灯片代码

{%endfor%}
替换点符号:

{% for item in page.thisslider %}
用括号表示法

{% for item in page[thisslider] %}
{% for item in page[thisslider] %}