YAML Front Matter Defaults Not Working


#1

I’ve been trying for hours now, and I can’t get my defaults to work.
This is my _config.yml:

title: Graphic Design Chicago
locale: en
markdown: kramdown
gems:
- jekyll-admin

collections:
 landingPages:
  output: true

...

 defaults:
 
- 
 
 scope:
   path: ''
   type: "pages"
  values:
   layout: "pages"
   permalink: pretty
   
- 
 
 scope:
   path: ''
   type: "landingPagess"
  values:
   layout: "landingPages"
   permalink: pretty
   
...

All advice appreciated :]


#2

Your indentations are inconsistent, probably because of the copy-pasting.

defaults: should start at 0 indentation.
The dashes signifying a new item should start at indentation 0 or at +2 or +4
scope: should start either on the same line as the dashes or the next line indented according to the dash.

Additionally, there’s a typo in the ["scope"]["type"] landingPagess

The corrected config should look like below:


collections:
  landingPages:
    output: true


defaults: 
  - 
    scope: 
      path: ""
      type: pages
    values: 
      layout: pages
      permalink: pretty
  - 
    scope: 
      path: ""
      type: landingPages
    values: 
      layout: landingPages
      permalink: pretty

#3

Thanks so much; I got it fixed with your advice.
I didn’t realise YAML had to be formatted to carefully.