How to list files in a directory with Liquid?

后端 未结 8 1597
日久生厌
日久生厌 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:28

    The Jekyll:DirectoryTag plugin from SillyLogger

    This tag lets you iterate over files at a particular path. The directory tag yields a file object and a forloop object. If files conform to the standard Jekyll format, YYYY-MM-DD-file-title, then those attributes will be populated on that file object.

    For example with images

      {% directory path: images/vacation exclude: private %}
    • {{ file.name }}
    • {% enddirectory %}

提交回复
热议问题