-
Notifications
You must be signed in to change notification settings - Fork 2
/
gatsby-node.js
30 lines (24 loc) · 1.25 KB
/
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
const { BlogNodeHandler, PageNodeHandler, RemarkRelativeImages } = require("./src/config/gatsby-node-handlers")
exports.createPages = async ({ graphql, actions, reporter }) => {
// https://www.gatsbyjs.com/docs/reference/config-files/actions/#createPage
// https://www.gatsbyjs.com/docs/reference/config-files/actions/#createRedirect
const { createPage, createRedirect } = actions
createRedirect({
fromPath: "/blog/2022/03/blog-18-caching-jwks-using-redis-with-django",
toPath: "/blog/2022/03/caching-jwks-using-redis-with-django",
isPermanent: true,
})
createRedirect({
fromPath: "/blog/2023/09/understanding-read-phenomena-by-practice-with-mariadb-and-postgresql",
toPath: "/blog/2023/09/understanding-read-phenomena-by-practice-with-mariadb-postgresql-and-sqlserver",
isPermanent: true,
})
await BlogNodeHandler.createPagesHandler(graphql, createPage)
await PageNodeHandler.createPagesHandler(graphql, createPage)
}
exports.onCreateNode = ({ node, actions, getNode }) => {
// https://www.gatsbyjs.com/docs/reference/config-files/actions/#createNodeField
const { createNodeField } = actions
BlogNodeHandler.createNodeHandler(createNodeField, getNode, node)
RemarkRelativeImages.createNodeHandler(createNodeField, node)
}