Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path/routing logic #25

Open
macintoshhelper opened this issue Apr 13, 2020 · 0 comments
Open

Path/routing logic #25

macintoshhelper opened this issue Apr 13, 2020 · 0 comments

Comments

@macintoshhelper
Copy link
Collaborator

macintoshhelper commented Apr 13, 2020

Proposal for path/routing logic:

Pseudo-code:

const routes = [{
  path: '/',
  component: 'pages/index',
}, {
  path: '/about',
  component: 'pages/index',
}, {
  path: '/terms',
  component: 'pages/terms',
}, {
  path: '/business/:id',
  component: 'templates/BusinessPage'
}, {
  path: '/category/:id',
  component: 'templates/CategoryPage'
}, {
  path: '/tag/:id',
  component: 'templates/TagPage'
}, {
  path: '/discover',
  component: 'templates/DiscoverPage'
}]

This is handled in the gatsby-node.js file: exports.createPages = function..., where the pages can be generated from API data, JSON file, files (e.g. docs/about.md), etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant