Skip to content

Commit

Permalink
docs: add list frontmatter example
Browse files Browse the repository at this point in the history
refs: #1282
  • Loading branch information
Zachatoo committed Jan 6, 2024
1 parent 8806dab commit b130e80
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ Then you can use the following template:
````
File's metadata alias: <% tp.frontmatter.alias %>
Note's type: <% tp.frontmatter["note type"] %>
````
````

For lists in frontmatter, you can use JavaScript array prototype methods to manipulate how the data is displayed.

```
---
categories:
- book
- movie
---
```

```
<% tp.frontmatter.categories.map(prop => ` - "${prop}"`).join("\n") %>
```

1 comment on commit b130e80

@mariusgerome
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<% tp.frontmatter.categories.map(prop => - "${prop}").join("\n") %>

so, soo great. life-saving-quality code.

Please sign in to comment.