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
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
<ul>
{% directory path: images/vacation exclude: private %}
<li>
<img src="{{ file.url }}"
alt="{{ file.name }}"
datetime="{{ file.date | date_to_xmlschema }}" />
</li>
{% enddirectory %}
</ul>
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 %}
<img src="{{ image }}" />
{% endloop_directory %}