Kick off your project with this blog boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React and TailwindCSS, a utility-first CSS framework for rapidly building custom designs.
I've added Notion.so as a cms as well as some plugins for seo, web site performance, rss feeds and support for dark mode.
Have another more specific idea? You may want to check out our vibrant collection of official and community-created starters.
Software Requirements
- Copy this to a blank text document and replace your name and email
docker build \
--build-arg GATSBY_THEME="https://github.com/kahunacoder/gatsby-notion-starter.git" \
--build-arg GIT_USER_NAME="Your Name" \
--build-arg GIT_EMAIL="you@youremail" \
https://github.com/kahunacoder/docker-gatsby.git -t gatsby-blog
- Paste edited version into your terminal.
- After the container is built paste this into your terminal
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog develop
- Proceede to step 3 below.
-
Create a Gatsby site.
Use the Gatsby CLI to create a new site, specifying the TailwindCSS blog starter.
# create a new Gatsby site using the blog starter gatsby new site https://github.com/kahunacoder/gatsby-notion-starter
-
Start developing.
Navigate into your new siteβs directory and start it up.
cd site/ gatsby develop
-
Open the source code and check the following!
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.
Replace the siteMetadata
fields with your own. Remove options you don't use.
siteMetadata: {
title: `Site Title`,
author: `Your name`,
description: `A blog.`,
siteUrl: `http://example.com/`,
siteVerification: {
google: ``,
bing: ``
},
social: {
twitter: ``,
linkedin: ``,
facebook: ``,
stackOverflow: ``,
github: ``,
instagram: ``,
pinterest: ``,
youtube: ``,
email: ``,
phone: ``,
fax: ``,
address: ``
},
keywords: ``,
organization: {
name: ``,
url: ``
},
},
Duplicate the table at https://www.notion.so/kahunacoder/b3189a381ce8490796fea90fa68310c2?v=4a46e38c7e514dee8ffbaf3ad690313e
Replace the table
url with the one you duplicated in the previuos step.
plugins: [
{
resolve: `@kahunacoder/docker-notion-database`,
options: {
sourceConfig: [
{
name: 'posts',
table: 'https://www.notion.so/kahunacoder/b3189a381ce8490796fea90fa68310c2?v=4a46e38c7e514dee8ffbaf3ad690313e',
cacheType: 'html'
}
]
}
}
]
In your terminal hold the control
key down and press the c
key
Verify your changes by pasting this (edit as needed) into the termianl and visiting http://localhost:8000
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog develop
Commands
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog sh
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog develop
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog develop-no-cache
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog stage
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 gatsby-blog build
Visit this url https://github.com/kahunacoder/docker-gatsby
A quick look at the top-level files and directories you'll see in a Gatsby project.
.
βββ node_modules
βββ src
βββ .gitignore
βββ .prettierrc
βββ gatsby-browser.js
βββ gatsby-config.js
βββ gatsby-node.js
βββ gatsby-ssr.js
βββ LICENSE
βββ package-lock.json
βββ package.json
βββ postcss.config.js
βββ README.md
βββ tailwind.config.js
-
/node_modules
: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. -
/src
: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.src
is a convention for βsource codeβ. -
.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-browser.js
: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). 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 you can specify information about your 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 build process. -
gatsby-ssr.js
: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering. -
LICENSE
: Gatsby is licensed under the MIT license. -
package-lock.json
(Seepackage.json
below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your 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 your project. -
postcss.config.js
: The PostCSS configuration file where TailwindCSS is configured as a plugin and other plugins like autoprefixer or postcss-purgecss can be added. -
README.md
: A text file containing useful reference information about your project. -
tailwind.config.js
: The TailwindCSS configuration file, see their documentation for more information on how to customize Tailwind.
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our 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 our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.
Edit this button to point to your own website when your ready.