How to list files in a directory with Liquid?

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

    You can use this plugin. Copy and paste this code in a file inside the _plugins directory at the root of your Jekyll project.

    https://gist.github.com/jgatjens/8925165

    Then to use it just add the lines below

    {% loop_directory directory:images iterator:image filter:*.jpg sort:descending %}
       
    {% endloop_directory %}
    

提交回复
热议问题