-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.ts
47 lines (42 loc) · 1.23 KB
/
gatsby-node.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { GatsbyNode } from "gatsby";
import { IGatsbyImageData } from "gatsby-plugin-image";
import { resolve } from 'path';
export const createPages = async ({ actions, graphql }) => {
const { createPage} = actions;
const { data } = await graphql(`
query Props {
allAvatarsYaml {
nodes {
username
# alias
# status
# email
# avatar {
# childImageSharp {
# gatsbyImageData(
# width: 50
# height: 50
# placeholder: BLURRED
# formats: AUTO
# )
# }
# }
}
}
}
`)
data.allAvatarsYaml.nodes.forEach(node => {
const {
username,
// alias,
// status,
// email,
// avatar
} = node;
actions.createPage({
path: username,
component: resolve('./templates/persona.tsx'),
context: { username },
})
})
}