Passing parameters to inclusion in Liquid templates

前端 未结 4 724
抹茶落季
抹茶落季 2021-01-30 12:49

On my Jekyll-powered website I have an inclusion that does something function-like, but I can\'t figure out how to pass it parameters correctly.

When I use {% incl

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 13:18

    Enter the variable without quotes or parentheses, like that:

    {% include footer.html param="value" variable-param=page.variable %}
    

    In your case:

    {% include function.liquid foo=baz.quux %}
    

    It works in my site.

    From: https://github.com/jekyll/jekyll/issues/3577#issue-61988857

提交回复
热议问题