Social Chain Media Editorial Gatsby Theme
π Quick start
-
Configuration.
Copy sample.env to .env.development and .env.production files in the local root directory Fill in blanks
Variable Description CLIENT_EMAIL This is your client email address from Google Analytics API GOOGLE_API_KEY The is the Google Analytics API Key DEPLOY_ENV This can either be lbn_published_stage or lbn_published_production depending on the environment You also need to add these to the Netlify environment variables before deploying to staging or production. See below.
-
Start developing.
Navigate into your new siteβs directory and start it up.
cd sc-editorial/ yarn develop
-
Open the source code and start editing!
Your site is now running at
http://localhost:8000
!Note: You'll also see a second link:
http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
π§ What's inside?
A quick look at the top-level files and directories you'll see in a Gatsby project.
.
βββ gatsby
βββ node_modules
βββ src
βββ static
βββ .gitignore
βββ .prettierrc
βββ gatsby-config.js
βββ gatsby-node.js
βββ package.json
βββ README.md
βββ yarn.lock
-
/gatsby
: This directory contains all of the files linked from gatsby-node.js. They create the pages, posts, author and category pages. -
/node_modules
: This directory contains all of the modules of code that the project depends on (npm packages) are automatically installed. -
/src
: This directory contains all of the code related to what you see on the front-end of the site (what you see in the browser) such as the site header or a page template.src
is a convention for βsource codeβ. -
/static
: Put files here that need to be placed at root level. i.e. robots.txt, ads.txt, favicon etc. -
.gitignore
: This file tells git which files it should not track / not maintain a version history for. -
.prettierrc
: This is a configuration file for Prettier. Prettier is a tool to help keep the formatting of your code consistent. -
gatsby-config.js
: This is the main configuration file for a Gatsby site. This is where you can specify information about the site (metadata) like the site title and description, which Gatsby plugins youβd like 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 (pages/posts etc) build process. -
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 your project. -
README.md
: A text file containing useful reference information about your project. -
yarn.lock
(Seepackage.json
above, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project by Yarn. (You wonβt change this file directly).
Setting up menus
In Wordpress set up two menus, one with the slug 'main-menu' for the main navigation and one with the slug 'footer-menu' for the footer navigation.