Last active
April 26, 2020 14:09
-
-
Save duffn/5c3d76ff15b373af191f0d46b8ed1ff6 to your computer and use it in GitHub Desktop.
Gatsby YAML Recipe Files
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
[ | |
{ | |
"name": "Leia Organa", | |
"profession": "Princess" | |
}, | |
{ | |
"name": " Luke Skywalker", | |
"profession": "Jedi Knight" | |
}, | |
{ | |
"name": "Han Solo", | |
"profession": "Nerf Herder" | |
} | |
] |
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
--- | |
- name: Leia Organa | |
profession: Princess | |
- name: Luke Skywalker | |
profession: Jedi Knight | |
- name: Han Solo | |
profession: Nerf Herder |
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
import React from "react" | |
import { graphql } from "gatsby" | |
const TestPage = ({ data }) => ( | |
<div> | |
<ul> | |
{data.allTestDataJson.nodes.map((node, index) => ( | |
<li key={index}> | |
{node.name} - {node.profession} | |
</li> | |
))} | |
</ul> | |
</div> | |
) | |
export const query = graphql` | |
query TestPageQuery { | |
allTestDataJson { | |
nodes { | |
name | |
profession | |
} | |
} | |
} | |
` | |
export default TestPage |
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
import React from "react" | |
import { graphql } from "gatsby" | |
const TestPage = ({ data }) => ( | |
<div> | |
<ul> | |
{data.allTestDataYaml.nodes.map((node, index) => ( | |
<li key={index}> | |
{node.name} - {node.profession} | |
</li> | |
))} | |
</ul> | |
</div> | |
) | |
export const query = graphql` | |
query TestPageQuery { | |
allTestDataYaml { | |
nodes { | |
name | |
profession | |
} | |
} | |
} | |
` | |
export default TestPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment