Get today's date in Jekyll with Liquid markup

后端 未结 4 1259
失恋的感觉
失恋的感觉 2021-01-30 19:38

This (should) be easy, I think, but I\'m unable to get today\'s date to show in a Jekyll page using Liquid markup. According to the documentation, I should be able to do this to

4条回答
  •  滥情空心
    2021-01-30 20:19

    To get the whole year, for example "2015", from the site.time, you can either use:

    {{ site.time | date: '%Y' }}
    # OR
    20{{ site.time | date: '%y' }}
    

    To just get the last 2 digits from the year 2015, this will just output "15":

    {{ site.time | date: '%y' }}
    

提交回复
热议问题