I'm getting this error in the command line terminal:
did not find expected key while parsing a block mapping at line 18 column 7
My jekyll _config.yml YAML file looks like this:
title: Oliver Williams - Portfolio
url: "http://yourdomain.com" # the base hostname & protocol for your site
# Build settings
markdown: kramdown
permalink: /:title
defaults:
-
scope:
path: "" # an empty string here means all files in the project
type: "posts" # previously `post` in Jekyll 2.2.
values:
layout: "post"
-
scope:
path: "" # an empty string here means all files in the project
type: "pages"
values:
layout: "page"
I'm not sure of your formating/indentation for _config.yml.
This one is correct :
title: Oliver Williams - Portfolio
url: "http://yourdomain.com"
markdown: kramdown
permalink: /:title
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
-
scope:
path: ""
type: "pages"
values:
layout: "page"
The problem is in your second list element for defaults. The marker is indented too much, possible because you used a tab instead of a two spaces.
There is no reason to put the mappings that are elements of those lists on a separate line. You also don't have to indent list elements if the list is a mapping value. Nor is it necessary to quote simple scalars like "posts"
, "page"
, etc. (You don't have that for your title
value either)
So you can do:
title: Oliver Williams - Portfolio
url: http://yourdomain.com # the base hostname & protocol for your site
# Build settings
markdown: kramdown
permalink: /:title
defaults:
- scope:
path: '' # an empty string here means all files in the project
type: posts # previously `post` in Jekyll 2.2.
values:
layout: post
- scope:
path: '' # an empty string here means all files in the project
type: pages
values:
layout: page
which is equivalent to your input (corrected for the overindented -
)
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