How to list files in a directory with Liquid?

后端 未结 8 1623
日久生厌
日久生厌 2020-12-28 14:01

I\'m trying to learn how to use Jekyll along with Bootstrap; while studying them, I decided that I\'d like to have an image carousel on my homepage.

Since I\'m real

8条回答
  •  没有蜡笔的小新
    2020-12-28 14:16

    Refer to docs you can list files in _post, _data as long there is its name in front matter.
    For images we need to put them first by _collection

    {% for file_hash in site.post %}
    {% assign file = file_hash[1] %}
    {{ file.name }}
    {% endfor %}
    

提交回复
热议问题