Jekyll Liquid : does post_url accept variable?

时间:2017-06-15 10:13:19

标签: jekyll liquid

this works fine:

{% post_url 2017-06-14-Home %}

but this doesn't:

{% assign mypost = '2017-06-14-Home' %}
{% post_url {{mypost}} %}

Why? This seems to be pretty straightforward...

EDIT

OK, so finally I ported my site to Pelican. Now it works just fine.

1 个答案:

答案 0 :(得分:0)

这很奇怪。我认为这是因为{% post_url 2017-06-14-Home %}' 2017-06-14-Home'不是一个字符串。它似乎应该是,但它可能实际上是一个对象。

不确定这是否有效但请尝试以下方法:

{% assign mypost = 2017-06-14-Home %}
{% post_url mypost %}