mardi 2 juin 2015

Jekyll - Front Matter defaults not working

Using Jekyll 2.5.3, I've tried to set default values in _config.yml (I'm just playing around to get a feel for it right now). I'm trying to set a default layout right now on a site I'm serving locally. I have set --watch and that's working fine. When I set any YAML defaults in _config.yml, Jekyll does not apply the defaults at all.

Here's the config file I'm currently using:

name: jekyll test
description: test server

url: "http://localhost:4000"

markdown: rdiscount
permalink: pretty

defaults:
  -
    scope:
      path: ""
    values:
      layout: "default"

The default layout is not applied to any page. I've tried with the title as well, with the same result.

My index.md:

---
title: index
----

{{  page.title  }}

My default.html:

<style>
    body {
        background-color: black;
        color: white;
        font-family: "Helvetica", Arial, sans-serif;
    }
</style>

<body>
    {{  content  }}
</body>

The default layout works fine when put into the YAML Front Matter of the index page itself, the main reason I'm looking for this is so I can apply default.html to 404 pages. The other elements in config.yml aren't giving me any trouble. Is there something I've done wrong?




Aucun commentaire:

Enregistrer un commentaire