Slide 1

Slide 1 text

Build Fast Website With Gatsby & WordPress Ritesh Vatwani @riteshvatwani

Slide 2

Slide 2 text

• What is Headless CMS? • JAMStack and it's benefits • What is Gatsby JS? • How does Gatsby JS Works? • How to Build Site using Gatsby + WordPress • How to deploy Gatsby site? • Solving your queries if you have any

Slide 3

Slide 3 text

Headless CMS

Slide 4

Slide 4 text

List 1-3 ways your company proposes to solve them. • A headless CMS is used for data capture, storage and delivery, making it frontend agnostic. • Its data can be displayed using any frontend technology, whether in a browser, mobile application, or elsewhere [email protected]

Slide 5

Slide 5 text

Headless CMS Traditional CMS Database Backend UI API View Database API Website Mobile App Smart Watch app Backend UI

Slide 6

Slide 6 text

JavaScript Api Markup

Slide 7

Slide 7 text

Dynamic functionalities are handled by JavaScript. There is no restriction on which framework or library you must use. Server side operations are abstracted into reusable APIs and accessed over HTTPS with JavaScript. These can be third party services or your custom function. Websites are served as static HTML files. These can be generated from source files, such as Markdown, using a Static Site Generator.

Slide 8

Slide 8 text

• Serve pre-built markup and assets over a CDN No need to worry about server or database vulnerabilities • • Hosting of static files are cheap or even free [email protected]

Slide 9

Slide 9 text

Front end developers can focus on the front end, without being tied to a monolithic architecture. This usually means quicker and more focused development If your product or article suddenly goes viral and has many active users, the CDN seamlessly compensates • • [email protected]

Slide 10

Slide 10 text

Fast in every way that matters

Slide 11

Slide 11 text

• Gatsby is a free and open source framework based on React and GraphQL • Helps to build blazing fast websites and apps [email protected]

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

• Can be used as a base in the development of single- page or mobile applications. • Server-side runtime for executing queries by using a type system you define for your data. • It is a JavaScript library for building user interfaces • GraphQL is a query language for APIs

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

npm install -g gatsby-cli

Slide 17

Slide 17 text

• gatsby new gatsby-with-wordpress-meetup • cd gatsby-with-wordpress-meetup • gatsby develop ( to starts the development server )

Slide 18

Slide 18 text

http://localhost:8000 /

Slide 19

Slide 19 text

http://localhost:8000/__graphql

Slide 20

Slide 20 text

• Config options for a Gatsby site, with meta data for project title, description, plugins, etc. • Implement Gatsby's Node.js APIs to customize and extend default settings affecting the build process [email protected]

Slide 21

Slide 21 text

• Customize and extend default setting affecting the browser, using Gatsby's browser APIs • Use Gatsby’s server-side rendering APIs to customize default settings affecting server- side rendering [email protected]

Slide 22

Slide 22 text

Using gatsby-source-wordpress Plugin

Slide 23

Slide 23 text

• Source plugin for pulling data into Gatsby from WordPress sites using the WordPress REST API. • Pulls data from self-hosted WordPress sites, or sites hosted on WordPress.com npm install --save gatsby-source-wordpress [email protected]

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

• run gatsby develop command in CLI (gatsby build - for production) • It will fetch all the posts from WordPress API and create the posts. • Before you run your first query, ensure the WordPress JSON API is working correctly by visiting /wp-json at your WordPress install.

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

• Custom Post Types • ACF (Advanced Custom Fields) • WP-API-MENUS which gives you the menus and menu locations endpoint. • WPML-REST-API which adds the current locale and available translations to all post types translated with WPML. • wp-rest-polylang which adds the current locale and available translations to all post types translated with Polylang. • Yoast

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Push to master Publish Content Webhook Webhook gatsby build Deploy

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

89

Slide 33

Slide 33 text

• reactjs.org • shopflamingo.com • sendgrid.com/docs/ • airbnb.io • Hopper.com

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Ritesh Vatwani [email protected] www.zestard.com