Front-matter
Any file that contains a YAML front matter block will be processed by OpooPress as a special file, we called blog source file. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Here is a basic example:
--- layout: post title: 'OpooPress 1.0.0 has been released' date: '2013-08-08 00:30' comments: true categories: ['opoopress'] url: '/article/opoopress-1.0.0-has-been-released/' ---
Between these triple-dashed lines, you can set predefined variables (see below for a reference) or even create custom ones of your own. These variables will then be available to you to access using FreeMarker tags in the source file of pages or posts.
1. Public Variables
Public variables that you can set in the front-matter of a page or post.
Variable | Description |
---|---|
|
The layout of current file. OpooPress defined three default layouts: |
|
The title of page or post. |
|
Creation or published time. This variable is required in a post. |
|
The time format of |
|
The update time. Optional. |
|
The time format of |
|
The relative path to |
|
The final URL of page or post. Optional. |
|
Current page / post whether to allow comments. Optional. default is |
|
Current page / post whether to allow side bar. Optional. default is |
|
Current page / post whether to contain footer. Optional. default is |
|
Author of this page or post. Optional. |
|
Keywords. Optional. It will be used as <meta name="keywords" content="keywords"> in the output HTML file. |
|
Desription. Optional. It will be used as <meta name="desription" content="desription"> in the output HTML file. |
2. Variables for Post Only
Variable | Description |
---|---|
|
Not draft. Default value is |
|
Category array. |
|
Tag. |
|
The excerpt of post. Optional. Show post excerpt and |
3. Custom Front-matter Variables
Any variables in the front matter that are not predefined are mixed into the data that is sent to the FreeMarker templating engine during the conversion. For instance, if you set var1 and var2, you can use that in your layout or other source file:
--- var1: "var1" var2: "a b c" ... --- The value of variable `var1` in this page is ${page.var1}. The value of variable `var2` in this page is /${page.var2}/. The url of this site is ${site.url}
output
The value of variable `var1` in this page is var1. The value of variable `var2` in this page is /a b c/. The url of this site is http://www.opoopress.com.
Also see Jekyll Front-matter for more.