Suppose I have the following index.md in my Gatsby app:
---
title: "Names"
numberOfNames: "3"
---
Now I would like to add an array of separate names like "Alex", "Bill", "Jack" under "names" tag.
How would I represent that array in a markdown file so that later I could iterate over it in my .js file?
frontmatter use yaml syntax. You can declare an array like so:
names:
- Alex
- Ben
- ...
or
names: ['Alex', 'Ben', ...]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With