How to pass a variable into a custom tag in Liquid?

后端 未结 3 1621
独厮守ぢ
独厮守ぢ 2021-02-19 11:25

I have written a custom tag in liquid, and I\'d like to pass a variable to it. Liquid tags will turn any parameter into a string.

For example:

{% nav pag         


        
3条回答
  •  无人及你
    2021-02-19 12:15

    If you are using Jekyll specifically, you can access the page variable this way:

    def render(context)
      page_url = context.environments.first["page"]["url"]
    

提交回复
热议问题