您可以将日期分配给 jekyll 中的变量吗?

Can you assign date to a variable in jekyll?

这是我目前正在尝试的,但它无法处理...

    {% assign current_month = {{ site.time | date: '%m' }} %}

你是怎么使用这个变量的?

{% 分配 current_month = {{ site.time |日期:'%m' }} %}

{{ current_month }}

将输出当前月份。

删除多余的括号:

{% assign current_month = site.time | date: '%m' %}