A rebuild of my professional blog/portfolio site with Gatsby
.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Requires node
with npm
. See Installing Node.js via package manager for installation instructions.
Requires gatsby-cli
to be installed globally. See gatsby-cli for more options and details.
npm i -g gatsby-cli
Some instructions also assume you are using git
. See Getting Started - Installing Git for installation instructions.
-
Fork the repo with the
Fork
button at the top of the repo page. -
Clone the forked repo locally and change directory into it.
git clone <forked_github_repo>
cd <forked_github_repo>
- Install local dependencies with
npm
oryarn
npm i
- Launch the dev server with hot reloading
gatsby develop
# once complete, open the site at `http://localhost:8000/` in the browser
# open GraphiQL in the browser or with GraphQL Playground at `http://localhost:8000/___graphql`
⚠️ Typically, you will want to stop the server and rerun this command after each time you change eithergatsby-config
orgatsby-node
or add newyaml
properties to the markdown files. Type control + c to stop the server.
- Build the static site in the
public
directory
gatsby build
- Serve the static site from the
public
directory
gatsby serve
Deploy with now
❗ This method is currently failing.
- Install the latest version of
now
globally
npm i -g now
- Authenticate and or deploy with
now
now
Deploy with netlify (preferred)
-
Fork the repo.
-
Sign up for a new account and or login to Netlify.
-
Click
New site from Git
-
Select the forked repo.
-
Grant Netlify access to your Github account.
Once these steps are completed. Netlify will deploy the site and provide you with a URL.
-
To use
Netlify CMS
, change the value ofrepo
instatic/admin/config.yml
to the name of your forked repo. -
From your Github account, navigate to
Settings > Developer Settings
-
Choose
New OAuth App
-
Enter a value for
Application name
andHomepage URL
-
Enter
https://api.netlify.com/auth/done
as the value forAuthorization callback URL
-
Click the submit button to create
-
From the Netlify panel, navigate to your site dashboard and to
Settings > Access Control > OAuth
-
Click
Install provider
-
In the modal, choose
GitHub
and enter theClient ID
andClient Secret
from the new OAuth app you setup on Github. -
Now when you navigate to
/admin
from your site, you should be able to access the admin panel by logging in with your Github account.
- gatsby-cli - Blazing fast modern site generator for React
- styled-components - Visual primitives for the component age
- Phil Gray - Initial work - thephilgray