-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbak.gatsby-node.js
50 lines (45 loc) · 1.34 KB
/
bak.gatsby-node.js
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
48
49
50
// import { GatsbyNode } from "gatsby";
// import { IGatsbyImageData } from "gatsby-plugin-image";
// import { resolve } from 'path';
const path = require('path');
exports.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
# )
# }
# }
}
}
}
`)
console.log(data.allAvatarsYaml.nodes);
data.allAvatarsYaml.nodes.forEach(node => {
const {
username,
// alias,
// status,
// email,
// avatar
} = node;
console.log(username)
actions.createPage({
path: username,
component: path.resolve('./templates/persona.tsx'),
context: { username },
})
})
}