Gatsby: The Definitive Guide: Build and Deploy Highly Performant JAMstack Sites and Applications
- Length: 500 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-12-21
- ISBN-10: 1492087513
- ISBN-13: 9781492087519
- Sales Rank: #3001889 (See Top 100 Books)
Get the definitive guide on Gatsby, the JavaScript framework for building blazing-fast websites and applications. Used by Nike, Costa Coffee, and other companies worldwide, Gatsby is emerging as one of the key technologies in the Jamstack (JavaScript, APIs, and markup) ecosystem. With this comprehensive guide, you’ll learn how to architect, build, and deploy Gatsby sites independently or with CMSs, commerce systems, and other data sources.
Author Preston So begins by showing you how to set up a Gatsby site from scratch. From there, you’ll learn ways to use Gatsby’s declarative rendering and GraphQL API, build complex offline-enabled sites, and learn how to continuously deploy Gatsby sites on a variety of platforms, including Gatsby Cloud.
- Discover how Gatsby integrates with many data sources and plug-ins
- Set up, configure, and architect Gatsby sites using Gatsby’s CLI, React, JSX, and GraphQL with high performance out of the box
- Build an independent Gatsby site based on Markdown and data- and content-driven Gatsby sites that integrate with CMSs and commerce platforms
- Deploy Gatsby sites on a variety of platforms with full CI/CD and test coverage, including Netlify, Vercel, and Gatsby Cloud
1. Gatsby Fundamentals 1.1 What is Gatsby? 1.1.1 Gatsby pages and components 1.1.2 Gatsby’s data layer: GraphQL and source plugins 1.1.3 The Gatsby ecosystem 1.2 Why Gatsby? 1.2.1 Performance 1.2.2 Accessibility 1.2.3 Developer experience 1.2.4 Security 1.3 Gatsby and the Jamstack 1.3.1 Static site generators 1.3.2 Distributed content and commerce 1.3.3 The Jamstack 1.4 JavaScript in Gatsby 1.4.1 Command-line interfaces 1.4.2 Modular JavaScript 1.5 React in Gatsby 1.5.1 Declarative rendering with JSX 1.5.2 React components 1.5.3 React props 1.6 Getting going with Gatsby 1.6.1 The command line 1.6.2 Installing the Gatsby CLI 1.7 Creating your first Gatsby site 1.7.1 Starting a development server 1.7.2 Creating a production build 1.7.3 Serving the production build locally 1.8 Conclusion 2. Core Elements of Gatsby 2.1 The Gatsby CLI 2.1.1 Installing and configuring the Gatsby CLI 2.1.2 gatsby new 2.1.3 gatsby develop 2.1.4 gatsby build 2.1.5 gatsby serve 2.1.6 Other useful Gatsby CLI commands 2.2 Starters 2.2.1 Official and community starters 2.2.2 Modifying starters 2.2.3 Creating a new project from a starter 2.2.4 The gatsby-config.js file 2.3 Gatsby pages and components 2.3.1 Pages 2.3.2 Components 2.3.3 Linking between pages 2.4 The layout component 2.5 Using CSS in Gatsby 2.5.1 Global styling 2.5.2 Modular styling with CSS Modules 2.5.3 CSS-in-JavaScript 2.6 Extending Gatsby with plugins 2.6.1 Installing Gatsby plugins 2.6.2 Loading plugins from local plugins 2.7 Conclusion 3. Adding Features to Gatsby Sites 3.1 Pages and routing in Gatsby 3.1.1 Rehydration 3.1.2 Static pages 3.1.3 Hybrid application pages 3.1.4 Client-only routes 3.1.5 Differences between Gatsby sites and React applications 3.2 Adding forms 3.2.1 Basic forms 3.2.2 Handling form submissions 3.3 Adding localization and internationalization 3.3.1 gatsby-plugin-i18n 3.3.2 react-intl 3.3.3 react-i18next 3.4 Adding an XML sitemap 3.5 Adding a 404 page 3.6 Adding analytics 3.7 Conclusion 4. GraphQL and the Gatsby Data Layer 4.1 GraphQL fundamentals 4.1.1 GraphQL queries 4.1.2 GraphQL fields 4.1.3 GraphQL arguments 4.1.4 GraphQL query variables 4.1.5 GraphQL directives 4.1.6 GraphQL fragments 4.1.7 GraphQL schemas and types 4.2 The Gatsby data layer 4.2.1 GraphiQL 4.2.2 GraphiQL Explorer 4.2.3 GraphQL Playground 4.3 Page and component queries 4.3.1 Page queries 4.3.2 Component queries with StaticQuery 4.3.3 Component queries with the useStaticQuery hook 4.4 Conclusion 5. Source Plugins and Sourcing Data 5.1 Using source plugins 5.1.1 Installing source plugins 5.1.2 Setting up source plugins 5.2 Sourcing data from the file system 5.2.1 Setting up gatsby-source-filesystem 5.2.2 Working with files from the file system 5.2.3 Working with multiple directories in the file system 5.3 Sourcing data from database systems 5.3.1 Amazon Redshift, SQLite3, Oracle, and MSSQL 5.3.2 MongoDB 5.3.3 MySQL 5.3.4 PostgreSQL 5.4 Sourcing data from third-party SaaS services 5.4.1 Airtable 5.4.2 AWS DynamoDB 5.4.3 Google Docs 5.5 Sourcing data from content management systems and commerce systems 5.5.1 Contentful 5.5.2 Drupal 5.5.3 Netlify CMS 5.5.4 Prismic 5.5.5 Sanity 5.5.6 Shopify 5.5.7 WordPress 5.6 Sourcing data from other sources 5.6.1 Sourcing data from GraphQL APIs 5.6.2 Sourcing data from JSON and YAML 5.7 Conclusion 6. Programmatic Page Creation 6.1 Traversing GraphQL data in pages 6.2 Working with transformer plugins 6.2.1 Adding transformer plugins 6.2.2 Transforming Markdown into data and HTML 6.2.3 Adding a list of Markdown pages 6.3 Working with gatsby-node.js 6.3.1 Creating slugs for Markdown pages 6.3.2 Adding a template 6.3.3 Adding Markdown pages with createPages 6.4 Conclusion 7. Assets in Gatsby 7.1 Working with assets 7.1.1 Assets 7.1.2 Importing assets directly with Webpack 7.1.3 Querying for assets with gatsby-source-filesystem 7.1.4 Importing assets with the static folder 7.2 Working with images 7.2.1 The gatsby-image component 7.2.2 Using gatsby-image 7.2.3 Optimizing externally hosted images 7.3 Working with videos 7.3.1 Creating custom components for hosted videos 7.3.2 Querying videos from Markdown using GraphQL 7.3.3 Self-hosting your own videos 7.4 Working with fonts 7.4.1 Adding local fonts 7.4.2 Adding web fonts 7.5 Conclusion 8. Adding Data-Driven Features to Gatsby Sites 8.1 Adding site search 8.1.1 Implementing site search with Algolia 8.1.2 Configuring gatsby-plugin-algolia 8.1.3 Querying pages with GraphQL for indexing 8.2 Adding a commenting system 8.3 Adding taxonomy to blog posts 8.3.1 Adding tags and querying for all tags 8.3.2 Adding a tag page template 8.3.3 Programmatic tag page creation with gatsby-node.js 8.3.4 Adding a tag index page 8.4 Adding pagination 8.4.1 Preparing for pagination in page templates 8.4.2 Generating paginated pages with gatsby-node.js 8.5 Adding an RSS feed 8.5.1 Adding an RSS feed to a Markdown blog 8.5.2 Adding an RSS feed for non-Markdown content 8.6 Adding authentication 8.6.1 Preparing for authentication 8.6.2 Creating client-only routes 8.6.3 Managing private routes 8.6.4 Providing privileged data to routes 8.7 Conclusion 9. Gatsby Plug-ins and Starters 9.1 Creating Gatsby starters 9.1.1 Gatsby starter requirements 9.1.2 Enabling starter configuration 9.1.3 Starter performance and accessibility 9.1.4 Licensing, testing, and releasing starters 9.2 Creating Gatsby plug-ins 9.2.1 Plugin nomenclature 9.2.2 Plugin configuration with options 9.2.3 Initializing a new plugin project 9.2.4 Interacting with Gatsby lifecycle APIs 9.3 Creating source plugins 9.3.1 Initializing projects for source plugin development 9.3.2 Installing the source plugin 9.3.3 Creating GraphQL nodes 9.3.4 Querying and sourcing remote data 9.3.5 Establishing foreign key relationships 9.3.6 Using plugin options to allow customization 9.4 Creating transformer plug-ins 9.4.1 Reviewing an example: gatsby-transformer-yaml 9.4.2 Ensuring needed data is sourced 9.4.3 Transforming nodes 9.4.4 Establishing the transformer relationship 9.4.5 Creating new nodes from derived data and querying 9.5 Publishing and maintaining plugins 9.5.1 Submitting plugins to the Gatsby plugin library 9.5.2 Maintaining plugins 9.6 Conclusion 10. Gatsby Themes 10.1 Gatsby themes in context 10.1.1 Differences from plugins and starters 10.1.2 Deciding between using and creating a theme 10.2 Using Gatsby themes 10.2.1 Starting a new site from a theme 10.2.2 Using a theme in an existing site 10.2.3 Using multiple Gatsby themes 10.3 Creating Gatsby themes 10.3.1 Creating new themes 10.3.2 Gatsby theme conventions 10.3.3 Converting starters into themes 10.4 Theme shadowing 10.4.1 Theme shadowing in gatsby-theme-blog 10.4.2 Shadowing other files 10.4.3 Extending shadowed files 10.5 Conclusion 11. Debugging and Testing Gatsby 11.1 Testing Gatsby 11.1.1 Unit testing with Jest 11.1.2 Testing React components 11.1.4 Visual testing with Storybook 11.1.5 End-to-end testing with Cypress 11.2 Debugging Gatsby 11.2.1 Debugging static builds 11.2.2 Debugging the build process 11.2.3 Debugging server-side rendering issues 11.2.4 Debugging cache issues 11.2.5 Debugging asynchronous lifecycle methods 11.3 Conclusion 12. Deploying Gatsby 12.1 Environment variables 12.1.1 Defining environment variables 12.1.2 Using environment variables 12.2 Using path and asset prefixes 12.2.1 Path prefixes 12.2.2 Asset prefixes 12.3 Deploying to hosting services 12.3.1 Netlify 12.3.2 Vercel 12.3.3 Gatsby Cloud 12.3.4 AWS Amplify 12.3.5 Azure 12.3.6 Amazon S3 12.3.7 Heroku 12.3.8 Firebase 12.3.9 GitHub Pages 12.4 Conclusion
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Gatsby: The Definitive Guide: Build and Deploy Highly Performant JAMstack Sites and Applications
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.