npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ob-frontend

v1.1.3-beta

Published

A headless WordPress starter theme built with Gatsby

Downloads

15

Readme

Table of contents

Overview

ob-frontend is a modern implementation of the WordPress frontend as a single-page application (SPA). This template, developed and packaged as a Gatsby starter, is a solution for developers looking for the ease-of-use and flexibility that comes with using WordPress as a CMS, paired with the familiar development experience and modern UI features of a React/GraphQL implementation. The ob-frontend Gatsby Starter attempts to closely mirror many of the core features and functionality of the familiar WordPress UI, such as nested comments, post sidebar layout, and a mailing list widget.

Demo

View a live demo of this application here.

Screenshots

Features

  • Post, page, and comment list functionality supported by Apollo client.
  • Modern UI powered by Bloomer React components for Bulma.
  • Feature-rich design capabilities supported by Sass.
  • Dynamic support for changing theme colors.
  • Support for featured posts on homepage.
  • Mailing list integration with Mailchimp.
  • Functionality for searching posts.
  • Support for threaded (nested) comments 2 levels deep.
  • Functionality for posting top-level (parent) comments.
  • Functionality for adding replies to nested (child) comments.
  • Mobile-first responsive design.
  • Pagination support.
  • React-icons.

Core Dependencies

Directory Structure

📂 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

1. Deploy a WordPress backend

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.

2. Configure a domain name

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. Create a Gatsby site

Use the Gatsby CLI to create a new site, specifying the ob-frontend starter.

# Create a new Gatsby site using the ob-frontend starter  
gatsby new blog https://github.com/onepagezen/ob-frontend  

4. Create environment variable files

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:

# 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  

5. Add development environment variables

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:

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

6. Add production environment variables

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:

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

7. Deploy the application

We recommend deploying ob-frontend to Netlify, as it integrates well with Gatsby. To deploy to Netlify, follow the instructions in the Deploy to Netlify section of this README.

Deploy to Netlify

1. Deploy the site

Use the Deploy with Netlify button to quickly deploy a website based on this starter:

2. Configure environment variables

When deploying with Netlify, make sure to add the production environment variables to your Netlify build environment. One option is to add them in your site dashboard under Settings > Build & deploy > Environment > Environment variables.

Credits

Contributors

|| :---: | :---: | | petejos80 | leronamin |

License

The MIT License (MIT)

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.