or what happens when two Potter geeks decide to start a blog about frontend
-
Clone the repo
-
Install dependencies
Make sure you have
node
andnpm
installed first. Navigate into the cloned directory and install dependencies through npm:cd expecto-frontendum npm ci
-
Start developing
Start the blog locally:
npm start
-
Open the source code and start editing
The blog is now running at
http://localhost:8000
!Note: You'll also see a second link:
http://localhost:8000/___graphql
. This is a tool we use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
Create a feature branch and open a new pull request to the base branch. Avoid commiting straight to master.
Deploy the blog to github pages:
npm run deploy
Note: Default deploy commit is "Updates". To be changed
A quick look at the top-level files and directories you'll see in a Gatsby project.
.
├── .cache
├── content
├── node_modules
├── public
├── src
├── static
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── LICENSE
├── package-lock.json
├── package.json
└── README.md
-
/.cache
: Filse generated by Gatsby and used by it internally (visible only after runninggatsby develop
orgatsby build
). -
/node_modules
: This directory contains all of the modules of code that the project depends on (npm packages) are automatically installed. -
/public
: Output folder for static files generated Gatsby (visible only after runninggatsby develop
orgatsby build
). This is what gets deployed online. -
/content
: Contains blog posts and other content-related files (like authors list). -
/src
: This directory will contain all of the code related to what you will see on the front-end of the site (what you see in the browser) such as site's header or a page template.src
is a convention for “source code”. -
/static
: Contains files not processed during build step (they're copied directly to the output folder). -
.eslintc.js
: This is a ESLint configuration file. It helps us keep the code linted. -
.gitignore
: This file tells git which files it should not track/maintain a version history for. -
.prettierrc
: This is a configuration file for Prettier. Prettier is a tool to help keep the formatting of the code consistent. -
gatsby-browser.js
: This file is where Gatsby expects to find any usage of the Gatsby browser APIs. These allow customization/extension of default Gatsby settings affecting the browser. -
gatsby-config.js
: This is the main configuration file for a Gatsby site. This is where we specify information about the site (metadata) like the site title and description, which Gatsby plugins to include, etc. (Check out the config docs for more detail). -
gatsby-node.js
: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. -
LICENSE
: Gatsby is licensed under the MIT license, and so is this project. -
package-lock.json
(Seepackage.json
below, first). This is an automatically generated file based on the exact versions of npm dependencies that were installed for this project. (You won’t change this file directly). -
package.json
: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for this project. -
README.md
: A text file containing useful reference information about the project.
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers it is recommended to start with an in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples, head to GatsbyJS documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.