A presentation at WordCamp US in in St. Louis, MO, USA by Muhammad Muhsin
Using WordPress With Static Site Generators @muhsinlk
Muhammad Muhsin
JAMstack
Static Site Generators
Content Static Site Generator Static Site Template
Why Gatsby?
Blazing Fast ⚡
Super secure 🔐
https://www.gatsbyjs.org/blog/2018-06-14-escalade-sports-from-5000-to-5-in-hosting/ Very cheap 💰
UX DX 🙂 vs 🤓 Gatsby has great UX too! Awesome Developer Experience (DX) 🛠
Easy to get started 🚀
♥ https://youtu.be/y73pFmTlR9Q Learn React and GraphQL on the go 📚
So, what really is Gatsby?
What Is Gatsby? ● A blazing fast React-based static site generator ● An application framework ● Connects to multiple APIs ● Build JAMstack sites ● Hydrates to a React app
React ● Replaces the view layer of your application ● Declarative, Composable and Reusable Components ● Write HTML (JSX) within JavaScript ● Virtual DOM
GraphQL ● Ask for what you need, get exactly that ● An alternative to REST API ● Single endpoint ● Get many resources in a single request ● Created by Facebook, now open source
❤
2 Ways 1. Using WordPress REST API 2. Using WPGraphQL
Using WPGraphQL ● Install gatsby-source-graphql plugin ● Fetches from GraphQL and stitches the schema ● Needs WPGraphQL plugin ● Faster ● More scalable
WPGraphQL ● Exposes WordPress data as GraphQL schema ● Open source project ● Created by Jason Bahl ● Install a WordPress plugin ● Has add-ons for ACF and more…
Starting a Gatsby Project
npm install —global gatsby-cli gatsby new my-project cd my-project gatsby develop
Enter Gatsby Themes
Gatsby Themes ● Abstract away code into a separate package ● Let end user focus on content ● Use multiple themes on the same project ● Child theme support
Gatsby WP Themes ● Porting WordPress themes to Gatsby ● Initiated by Zac Gordon ● Twenty Nineteen Gatsby Theme ● Tabor Gatsby Theme ● Check out GatsbyWPThemes.com
Lessons
Don’t put everything in one place.
Be a part of the growing community!
You may not need a SSG!
Why not Gatsby? ● Content not available immediately ● No incremental builds (yet) for WordPress ● Most WP Plugins may not work out of the box
What we covered ● JAMstack & SSGs ● Gatsby ● WordPress + Gatsby ● gatsby-source-graphql ● WPGraphQL ● Gatsby Themes
Next steps! ● Gatsby and WordPress – best friends or foes? ● Tutorial on creating a Gatsby Theme based on Twenty Nineteen WordPress Theme ● Gatsby + WordPress with WPGraphQL (with Jason Bahl) — Learn With Jason ● Watch Jason’s talk on Gatsby + WPGraphQL
Thank you! 😊 _ Jason Bahl @muhsinlk Tessa Kriesel muhammad@rtcamp.com
We are hiring! 🤗 rt.camp/join
Credits - Image Sources ● JAMstack ● JAMstack website ● Static Site Generators: Content Laptop Gears ● Easy to get started ● What Is Gatsby? ● Be a part of the growing community!
Static sites (or JAMstack sites) are all the rage now. In this talk, I want to discuss why you need to consider Static Site Generators like Gatsby. Are they eating up WordPress’ market share? How can WordPress stay relevant in this age of Gatsby and other SSGs? I will talk about my personal experiences using WordPress with Gatsby.
A few lessons and tips will be shared for anyone deciding to use WordPress as a Headless CMS for their static sites.
Here’s what was said about this presentation on social media.
Catch rtCampers @HrMervin and @muhsinlk at @WordCampUS. 👋@muhsinlk will be speaking remotely on "Using #WordPress With Static Site Generators" along with @jasonbahl. 🗣️#WCUS #WordCamp pic.twitter.com/Wxvi3md6bN
— rtCamp (@rtCamp) October 31, 2019
🛫 At the airport headed to WordCamp US! Excited to see some familiar faces and meet many new people!
— JSON Bahl (@jasonbahl) October 31, 2019
😃 Very happy to be there on behalf of @gatsbyjs
📢 If you're attending #WCUS Come find me in the sponsor area and catch my talk with @muhsinlk at the end of the day tomorrow.
4:15 Rm 240 Join Jason Bahl & Muhammad Muhsin for "Using WordPress With Static Site Generators." A few lessons and tips will be shared for anyone deciding to use WordPress as a Headless CMS for their static sites.#WCUS @jasonbahl @muhsinlk pic.twitter.com/xhwRxaquD1
— WordCamp US (@WordCampUS) November 1, 2019
@muhsinlk @jasonbahl presenting on #Headless #WordPress @rtCamp pic.twitter.com/uVK8cSwLdn
— Mervin 💾 (@HrMervin) November 1, 2019
.@jasonbahl and @muhsinlk (via video) are presenting at 4.15pm on ‘Using WordPress With Static Site Generators’ in Room 240. #WCUS #WCUS2019 pic.twitter.com/Jsoh7iG0cS
— Hajj Flemings (@HajjFlemings) November 1, 2019
So great to see @jasonbahl and @muhsinlk breaking past VISA limits to bring Muhammad on stage to present on Headless WordPress and @gatsbyjs at @WordCampUS #WCUS pic.twitter.com/5S15Daz7Ai
— Zac Gordon (@zgordon) November 1, 2019
Packed house for @gatsbyjs + @wpgraphql talk at #wcus. The future of the front end is decoupled.
— Morten @ home (@mor10) November 1, 2019
Wrapping up Day 1 of #WCUS with a couple of lightning talks about headless WordPress, static sites, and Gatsby. Important note - GatsbyJS is more than a SSG. It's an app framework built on React. https://t.co/QXEARTSVMK via @jasonbahl
— Andy McIlwain (@andymci) November 1, 2019
@jasonbahl and @muhsinlk talking about static site generators with WordPress at #wcus pic.twitter.com/GuNlhqHQVN
— Scott Bolinger (@scottbolinger) November 1, 2019
Great talks from @muhsinlk (from far away) and @jasonbahl. I finally have a basic idea of what @gatsbyjs is! https://t.co/xMvgViMrG2
— Kathy Darling (@Kathy_Darling) November 1, 2019
The fact that Muhammad, a rightful #WCUS speaker, couldn't get into the country to deliver his own talk reminds us we have to keep working, not only for an open web, but for an open and inclusive world.
— » Luis Herranz (@luisherranz) November 1, 2019
(and this happens in Europe too)
It was an amazing talk @muhsinlk 👏👏 https://t.co/Ln9APaCa73
You both did a great job! Future is indeed decoupled, like @mor10 said.
— Dmitry Mayorov (@dmtrmrv) November 1, 2019
I had a blast co-presenting with @muhsinlk about @gatsbyjs at #WCUS!
— JSON Bahl (@jasonbahl) November 2, 2019
Here are my slides: https://t.co/85mjCax9D7
Here’s the repo to the Gatsby Kanban app I demoed: https://t.co/oWr56fBoHR
Amazing talk by @muhsinlk and @jasonbahl about @gatsbyjs and headless WordPress!@jasonbahl could you please share the repo of the gatsby/trello like app! can't wait to dig into it :-) https://t.co/9mvEM7Ugsu
— Alexandra Spalato (@alexadark) November 2, 2019
Overwhelming to receive so much love from the community! ❤️ Still not sure what I did to receive so much love! 😉 Thank you everyone 🤗 https://t.co/K0lgBckbko
— Muhammad Muhsin (@muhsinlk) November 4, 2019