-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: All about Data | ||
layout: base.html | ||
--- | ||
|
||
# All about Data | ||
|
||
## Data Cascade | ||
|
||
### Data provided by Sissi | ||
|
||
### The `_data` subdirectory | ||
|
||
### The Frontmatter | ||
|
||
## Using data inside templates | ||
|
||
Sissi supports a "poor girl's handlebars". It looks for expressions wrapped in double curly braces and replaces them with the data accordingly. If the data is resolved as a function, a parameterless function call will be invoked. If the data results a Promise, it is automatically resolved. | ||
|
||
If you place a javascript file named `meta.js` in your _data directory which provides a default export, you can access the object like this: | ||
|
||
```js | ||
export default { | ||
author: 'Lea' | ||
}; | ||
``` | ||
|
||
```html | ||
{\{ meta.author }\} | ||
``` | ||
|
||
Alternatively, you can put json or yaml into the data directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters