Using filters in Liquid tags

前端 未结 4 1348
广开言路
广开言路 2020-12-29 22:02

I\'m using jekyll and Liquid to generate a static web site on github pages.

I want to base some content decisions on whether the amount of content in a document has

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 22:07

    {% assign val = page.content | number_of_words %}
    {% if val > 200 %}
     ....
    {% endif %}
    

提交回复
热议问题