Tutorial by Examples

To create an albums collection, add the following to your config.yml file: collections: - albums Create a corresponding folder at the root of your Jekyll install, named exactly what you put in your config.yml file with an additional prepended underscore; in our example, <source>/_albums....
As of Jekyll 3.2, you can use the filter where_exp to filter a collection by any of its properties. Say you have the following collection item in an "albums" collection: --- title: My Amazing Album --- ... You can combine the where_exp and first filters to grab just that one item: ...
Given an 'albums' collection, you can loop through and output each item: {% for album in site.albums %} {{ album.content }} {% endfor %} Any custom front matter variables are also available within the loop. {% for album in site.albums %} {{ album.title }} {{ album.content }} {%...
Given an 'albums' collection, an item can be added by creating a file in the <source>/_albums directory. Note that files not including frontmatter will be ignored. For instance, adding a file called my_album.md to the _albums directory would add it to the collection: --- title: "My Alb...

Page 1 of 1