Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit ce43586

Browse files
authored
Merge pull request #9 from prince-deriv/job-description-page
Prince/ add dynamic page for job-description
2 parents bd6a238 + 6638159 commit ce43586

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

gatsby-node.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
/* eslint-disable import/order */
22
const path = require('path')
33

4-
exports.onCreatePage = () => {}
4+
exports.onCreatePage = async ({ page, actions }) => {
5+
const { createPage } = actions
6+
7+
if (page.path.match(/^\/job-description/)) {
8+
page.matchPath = '/job-description/*'
9+
10+
// Update the page.
11+
createPage(page)
12+
}
13+
}
514

615
const StylelintPlugin = require('stylelint-webpack-plugin')
716
const TerserPlugin = require('terser-webpack-plugin')

src/pages/job-description/[id].tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react'
2+
import type { PageProps } from 'gatsby'
3+
import Layout from 'common/components/layout/layout'
4+
5+
const JobDescription = (props: PageProps) => {
6+
return (
7+
<Layout>
8+
<>{props.params.id}</>
9+
</Layout>
10+
)
11+
}
12+
13+
export default JobDescription

0 commit comments

Comments
 (0)