How to add a Collection
-
Create a folder called
_things
, remember you must put an underscore_
before the name -
Edit the
_config.yml
to add the following lines under thecollections
field, the collection name must match the folder name except the underscore1 2 3 4 5
collections: # ... omitting previous collections ... things: permalink: ":/collection/:path/" output: true
-
And find the line
just_the_docs
, add the collection you just defined1 2 3 4 5
just_the_docs: collections: # ... omitting previosus collections ... things: name: "Things"
-
And create a single page or page with child in the folder, here I just moved the
animals
folder we created in the last article inside the_things
Here we go
Some notes:
- You can change the order of the collection by rearranging the order inside the
just_the_docs
->collections
. - Remember to match the names defined in
collections
andjust_the_docs
->collections
. - After you add a collection, run
bundle exec jekyll serve
again to see the effects.