Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr committed Feb 14, 2024
1 parent 4eefe7e commit 4cd36a6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const path = require('path')

export.createPages = ({graphql, actions}) => {
const { createPage } = actions
const songTemplate = path.resolve('src/template/song.js')
return graphql(`query allSqliteSongsQuery {
allSqliteSongs {
nodes {
id
title
author
aka
}
}
}`).then(result => {
if (result.errors) throw errors
result.data.allSqliteSongs.edges.forEach(edge => {
createPage({
path: edge.node.title.toLowerCase(),
component: songTemplate,
context: {
foo: 'barrrrrr',
}
})
})
})
}

0 comments on commit 4cd36a6

Please sign in to comment.