Getting Started with Gatsby

install Gatsby

npm install --global gatsby-cli

# OR

yarn global add gatsby-cli

create a site

gatsby new gatsby-site

start a live server

gatsby develop

Directory Structure

  • pages

Linking between pages

There’s a builtin Link component

import Link from 'gatsby-link'
<Link to="/page-3/">Go to page 3</Link>

The link is going to the page located at src/pages/page-3.js. The slashes in /page-3/ are not necessary, the link will still work without them