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
Using the Jekyll collections API, which, as of 2015-08-07 came with the big warning
Collections support is unstable and may change
Define a collection in _config.yml
and creates an _images
folder in your root directory
collections:
- images
Without having to add YAML front-matter to your images, Jekyll will:
Files in collections that do not have front matter are treated as static files and simply copied to their output location without processing.
Static files have the following attributes:
file.path
file.extname
And then the code on your page would be something like (untested):
{% for image in site.images %}
{% if image.extname == 'jpg' %}
{% endif %}
{% endfor %}