Jekyll default (layout) Front Matter doesn't work: fixed

324 Views Asked by At

I was trying to set different layouts depending on the directory of the pages, like:

defaults:
  -
    scope:
      path: ""
      type: "pages"
    values:
      layout: "default"
  -
    scope:
      path: "www/grid"
      type: "pages"
    values:
      layout: "grid"
  -
    scope:
      path: "www/product"
      type: "pages"
    values:
      layout: "product"

As recommended, I saved the _config.yml file, stopped and rerun the jekyll serve command. Yet, after reloading the pages, nothing seemed affected.

1

There are 1 best solutions below

0
On

To solve the problem, I:

  1. Saved the _config.yml file
  2. Stopped the jekyll serve command
  3. Deleted the .jekyll-metadata file
  4. Run the jekyll serve command

After that everything worked fine.

The .jekyll-metadata (which I assume is some cache) file is rebuilt after the serve command.