Skip to content

Commit

Permalink
chore: more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
learosema committed Oct 10, 2024
1 parent 80abc17 commit 17366c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
33 changes: 33 additions & 0 deletions demo/data.md
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.

10 changes: 1 addition & 9 deletions demo/templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@ You can include HTML via the html-include tag. It will fetch the partial HTML sn

## Template Data

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:

```html
{{ meta.author }}
```

Alternatively, you can put json or yaml into the data directory.
Sissi supports a "poor girl's handlebars". It looks for expressions wrapped in double curly braces and replaces them with the data accordingly. More details on this is in the next section about data.

## Built-in filters

Expand Down

0 comments on commit 17366c0

Please sign in to comment.