soniCaH /
KCVV-Elewijt-Gatsby
| 1 | /** |
||
| 2 | * Implement Gatsby's Node APIs in this file. |
||
| 3 | * |
||
| 4 | * See: https://www.gatsbyjs.org/docs/node-apis/ |
||
| 5 | */ |
||
| 6 | |||
| 7 | // You can delete this file if you're not using it |
||
| 8 | require(`dotenv`).config({ |
||
| 9 | path: `.env`, |
||
| 10 | }) |
||
| 11 | const path = require(`path`) |
||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
| 12 | |||
| 13 | // const gatsbyNodePageQueries = require(`./src/gatsby/gatsbyNodePageQueries`) |
||
| 14 | // const { |
||
| 15 | // createArticles, |
||
| 16 | // createPages, |
||
| 17 | // createTeams, |
||
| 18 | // createPlayers, |
||
| 19 | // createStaff, |
||
| 20 | // createOverviewNews, |
||
| 21 | // createCategoryPages, |
||
| 22 | // } = require(`./src/gatsby/pageCreator`) |
||
| 23 | |||
| 24 | // const createPaginatedPages = require(`gatsby-paginate`) |
||
| 25 | |||
| 26 | // // graphql function doesn't throw an error so we have to check to check for the result.errors to throw manually |
||
| 27 | // const wrapper = (promise) => |
||
| 28 | // promise.then((result) => { |
||
| 29 | // if (result.errors) { |
||
| 30 | // throw result.errors |
||
| 31 | // } |
||
| 32 | // return result |
||
| 33 | // }) |
||
| 34 | |||
| 35 | // // Implement the Gatsby API “createPages”. This is called once the |
||
| 36 | // // data layer is bootstrapped to let plugins create pages from data. |
||
| 37 | // exports.createPages = async ({ graphql, actions }) => { |
||
| 38 | // const { createPage } = actions |
||
| 39 | // const articleTemplate = path.resolve(`src/templates/Article.tsx`) |
||
| 40 | // const pageTemplate = path.resolve(`src/templates/page.js`) |
||
| 41 | // const teamTemplate = path.resolve(`src/templates/team.js`) |
||
| 42 | // const playerTemplate = path.resolve(`src/templates/player.js`) |
||
| 43 | // const playerShareTemplate = path.resolve(`src/templates/player-share.js`) |
||
| 44 | // const staffTemplate = path.resolve(`src/templates/player-staff.js`) |
||
| 45 | // const newsOverviewTemplate = path.resolve(`src/templates/newsoverview.js`) |
||
| 46 | // const categoryTemplate = path.resolve(`src/templates/categoryPage.js`) |
||
| 47 | // const result = await wrapper( |
||
| 48 | // graphql(` |
||
| 49 | // query { |
||
| 50 | // ${gatsbyNodePageQueries} |
||
| 51 | // } |
||
| 52 | // `) |
||
| 53 | // ) |
||
| 54 | |||
| 55 | // createArticles(result.data.articles.edges, createPage, articleTemplate) |
||
| 56 | // createPages(result.data.pages.edges, createPage, pageTemplate) |
||
| 57 | // createTeams(result.data.teams.edges, createPage, teamTemplate) |
||
| 58 | // createPlayers(result.data.players.edges, createPage, playerTemplate, playerShareTemplate) |
||
| 59 | // createStaff(result.data.staff.edges, createPage, staffTemplate) |
||
| 60 | |||
| 61 | // createOverviewNews(result.data.articles.edges, createPaginatedPages, createPage, newsOverviewTemplate, `news`, 18) |
||
| 62 | |||
| 63 | // createCategoryPages(result.data.categories.edges, createPage, categoryTemplate) |
||
| 64 | // } |
||
| 65 | |||
| 66 | // exports.onCreatePage = async ({ page, actions }) => { |
||
| 67 | // const { createPage } = actions |
||
| 68 | |||
| 69 | // if (page.path.match(/^\/game\//)) { |
||
| 70 | // createPage({ |
||
| 71 | // path: `/game/`, |
||
| 72 | // matchPath: `/game/:id`, |
||
| 73 | // component: path.resolve(`src/pages/game.js`), |
||
| 74 | // }) |
||
| 75 | // } |
||
| 76 | // } |
||
| 77 |