A headless WordPress starter theme built with Gatsby
npm install ob-frontend




sh
š src
āāāš apollo # Apollo Client integration
āāāš comments # comment functionality for posts
āāāš components # layout and SEO components
āāāš images # local site images
āāāš mailchimp # mailing list integration
āāāš pages # all site pages
āāāš search # search and retrieve posts by query
āāāš styles # SCSS for styling
āāāš templates # dynamically generate posts and pages
`
Performance Tests
Quick Start
$3
This starter theme relies on a WordPress backend from which to fetch data related to WordPress posts, pages, comments, etc. You can deploy the WordPress backend using the hosting provider of your choice. Before moving to step 2, you must complete the following things:
+ Your WordPress backend must be populated with one of each of the following: a post, a page, a comment, and a featured image.
+ A tag of featured must be added to any posts you want to appear on the Featured Posts section of the homepage.
$3
Configure a domain name for your WordPress backend (with HTTPS). In this example, the WordPress backend is served from a subdomain (cms.example.com), and the WordPress frontend (ie. ob-frontend) is served from the root domain (example.com). Serving the WordPress backend from a subdomain is optional, however, you will need to change the SOURCE_URL environment variable to match the URL of your WordPress backend.
$3
Use the Gatsby CLI to create a new site, specifying the ob-frontend starter.
`sh
Create a new Gatsby site using the ob-frontend starter
gatsby new blog https://github.com/onepagezen/ob-frontend
`
$3
This theme relies heavily on enivronment variables in order to get up and running quickly. After creating the site using the Gatsby CLI (step 3), run the following commands to configure the environment variables for your site:
`sh
Navigate into your new site's directory
cd ob-frontend Create .env files for both the development and production environments
touch .env.development .env.production
`
$3
Add the following environment variables to your .env.development file, making sure to replace example.com with your own domain name, and MAILCHIMP_ENDPOINT with the form action URL of your MailChimp mailing list:
`sh
SITE_URL=https://localhost:8000
BASE_URL=cms.example.com
BASE_URL_PROTOCOL=https
SOURCE_URL=https://cms.example.com
REPLACEMENT_URL=localhost:8000
GATSBY_CLIENT_URL=https://cms.example.com/graphql
MAILCHIMP_ENDPOINT=https://example.us17.list-manage.com/subscribe/post?u=0893ac8473c98fa98eeef3fd5&id=f4cbbd81d6
`
$3
Add the following environment variables to your .env.production file, making sure to replace example.com with your own domain name, and MAILCHIMP_ENDPOINT with the endpoint of your Mailchimp mailing list:
`sh
SITE_URL=https://example.com
BASE_URL=cms.example.com
BASE_URL_PROTOCOL=https
SOURCE_URL=https://cms.example.com
REPLACEMENT_URL=example.com
GATSBY_CLIENT_URL=https://cms.example.com/graphql
MAILCHIMP_ENDPOINT=https://example.us17.list-manage.com/subscribe/post?u=0893ac8473c98fa98eeef3fd5&id=f4cbbd81d6
``
Copyright (c) 2016-2020 One Page Zen Systems, LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.