Skip to content

Commit

Permalink
View page updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Tesimune committed Oct 10, 2023
1 parent 7b0e1f1 commit 8a48b0d
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: ./public/
local-dir: ./public/
12 changes: 12 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ module.exports = {
siteUrl: `https://analogueshifts.com/`,
},
plugins: [
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/pages/jobs`,
},
},
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/pages/job`,
},
},
"gatsby-plugin-postcss",
`gatsby-plugin-image`,
{
Expand Down
19 changes: 19 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,27 @@
/**
* @type {import('gatsby').GatsbyNode['createPages']}
*/
const path = require('path');
const axios = require('axios');

exports.createPages = async ({ actions }) => {
const { createPage } = actions

try {
const response = await axios.get("https://api.analogueshifts.com/api/jobs")
const data = response.data.jobs

data.map(job => {
createPage({
path: `/jobs/${job.display}`,
component: path.resolve("./src/pages/jobs/display.js"), // Replace with your template path
context: job,
})
})
} catch (error) {
console.error("Error fetching data from the API:", error)
}

createPage({
path: "/using-dsg",
component: require.resolve("./src/templates/using-dsg.js"),
Expand Down
Loading

0 comments on commit 8a48b0d

Please sign in to comment.