For some reason I am unable to set defaults for my Jekyll collections. I think I have followed the documentation correctly but even setting a default layout
is alluding me..
Here's what I got:
collections:
work:
output: true
permalink: /work/:path/
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
-
scope:
path: "work"
type: "pages"
values:
layout: "work"
My blog post markdown files are in /_posts
and my work (collection) markdown files are in /_work
. In the example above, I want all work items to use the work
collection. How is this not working?
By the way, I am using Jekyll 3.3.1.
You are referring to pages that have the path 'work', while you want to refer to all items in the collection 'work'. This can be done by only specifying the 'type' (collection) and leaving the path empty, like this:
collections:
work:
output: true
permalink: /work/:path/
defaults:
- scope:
path: ""
type: "posts"
values:
layout: "post"
- scope:
path: ""
type: "work"
values:
layout: "work"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With