Git Product home page Git Product logo

blog-20's Introduction

Apollo Blog

Netlify Status

This website is a static Gatsby website, created using data served from a Wordpress instance running on WP Engine. It is built and deployed on Netlify, and leverages the NetlifyPress Wordpress plugin to trigger new deploys when content is created or updated.

Custom components

In this blog, we use some Wordpress features in creative ways to deliver custom functionality in our posts.

Quote share button

Wordpress Quote and Pullquote block types both get the same visual treatment, with one key difference: the "Tweet" button. To add a button prompting users to share the blockquote on Twitter, simply use the Pullquote block type in Wordpress, rather than the default Quote type.

Show/hide groups of elements

We transform Wordpress Group blocks into HTML <details> elements, allowing for progressive disclosure of complicated examples using native HTML.

By default, <details> elements have a summary message that reads "Details", but authors can override this message by supplying their own <summary> element as the first child within a Group block in Wordpress.

<summary>Expand for more details</summary>

Running Wordpress locally

To run Wordpress on your local machine, we use Local, an application that lets you start and stop local Wordpress instances, and push/pull data between your machine and our hosting provider.

Follow this guide to install Local on your machine, connect to our WP Engine account, and pull the apollographql site.

By default, Local uses it's own routing solution to serve Wordpress instances at the .local TLD. To run this site locally, you'll need to disable this feature by going into Preferences > Advanced > Router Mode, and selecting "localhost" from the dropdown.

Once you have a local copy of our Wordpress instance up and running, you're ready to start the Gatsby local development environment...

Local development

This project requires the Netlify CLI to run locally. We use Netlify to store the site's environment variables and run its serverless functions locally. If you don't already have it installed, install the Netlify CLI globally.

Run netlify init and select the default answers to each of the following prompts to connect your local site to our project on Netlify.

npm install -g netlify-cli
netlify init

Next, install the project's dependencies.

npm install

Finally, start your development environment. Take note of the "Site Host" value in your Local app. You'll need to supply this to the following call in the form of a WORDPRESS_URL_DEV environment variable. For instance, if your "Site Host" is localhost:10003, you can run the following command in your terminal:

WORDPRESS_URL_DEV=localhost:10003 netlify dev

Now, you should have a development server running at http://localhost:8888! ๐Ÿš€

Diagnosing site failures

In the event of an outage, one might want to check on the status of services that this site depends on. This site has two main 3rd-party points of failure:

Netlify

Status page

We use Netlify to build and host the static Gatsby site portion of this website. Site settings can be configured on Netlify.

Note: If a new deploy fails to build on Netlify, it won't have an effect on the site currently in production. Netlify will only deploy successful builds.

We also leverage Netlify redirects to proxy requests from /blog to our Netlify deployment. This redirect rule that does this can be found here.

WP Engine

Status page

The Wordpress component of this website is hosted by WP Engine. They are a service that specializes in secure Wordpress hosting.

One can log in to WP Engine using the login credentials found in 1Password. Once you're in there, you can do things like:

  • Change our hosting configuration
  • Update server software
  • View server access/error logs
  • Inspect/administrate the database using phpMyAdmin
  • Roll back the entire site to a previous daily backup
  • Contact WP Engine support

In case of a malware infection, WP Engine offers support for diagnosing and removing malware, excluding some circumstances. More information on this topic and their protocols can be found in this article from their website.

blog-20's People

Contributors

trevorblades avatar jgarrow avatar jchesterman avatar peggyrayzis avatar stemmlerjs avatar xanderjl avatar r4ph-t avatar tylerbarnes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.