Skip to content

Commit

Permalink
be more clear about the two options for defining front matter data
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed May 29, 2016
1 parent c164cc0 commit 0d19ce9
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ Here's a sample AsciiDoc file that meets these criteria:
[listing]
....
---
layout: page
permalink: /page/
---
= Sample Page
:page-layout: page
:page-permalink: /page/
This is a sample page composed in AsciiDoc.
Jekyll converts it to HTML using {uri-asciidoctor}[Asciidoctor].
Expand All @@ -138,6 +138,21 @@ puts "Hello, World!"
----
....

Alternatively, you can define the front matter data directly in the AsciiDoc header:

.sample.adoc
[listing]
....
---
---
= Sample Page
:page-layout: page
:page-permalink: /page/
This is a sample page composed in AsciiDoc.
...
....

AsciiDoc attributes defined in the document header whose names begin with `page-` are promoted to Jekyll front matter.
The part of the name after the `page-` prefix is used as the entry's key (e.g., page-layout becomes layout).
The value is parsed as https://en.wikipedia.org/wiki/YAML[YAML] data (that which can be expressed in a single line).
Expand All @@ -155,6 +170,8 @@ If the file begins with whitespace or a Byte Order Mark (BOM), then the front ma

TIP: You can use an empty front matter header, as shown above.
In this case, you define all the document metadata (e.g., layout) using AsciiDoc attributes instead of in the front matter.
You can also use a combination of both.
In this case, the attributes defined in the AsciiDoc header take precedence.

You can now build your site using:

Expand Down

0 comments on commit 0d19ce9

Please sign in to comment.