惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
量子位
人人都是产品经理
人人都是产品经理
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Recent Announcements
Recent Announcements
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
H
Help Net Security
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
The Cloudflare Blog
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
Vercel News
Vercel News

Maggie Appleton

The Dark Forest and Generative AI One Developer, Two Dozen Agents, Zero Alignment Gas Town’s Agent Patterns, Design Bottlenecks, and Vibecoding at Scale January 2026 | Maggie Appleton A Treatise on AI Chatbots Undermining the Enlightenment A Brief History & Ethos of the Digital Garden Vibe Code is Legacy Code May 2025 | Maggie Appleton Home-Cooked Software and Barefoot Developers Statistically, When Will My Baby Be Born? Speculative Calendar Events ChatGPT Would be a Decent Policy Advisor March 2025 | Maggie Appleton The Expanding Dark Forest and Generative AI Humanity's Last Exam Squish Meets Structure Common Misconceptions in AI Undetected AI Exam Answers Unbaited Smidgeons Growing a Human: The First 30 Weeks How to Import Academic Papers from Zotero into Tana December 2024 | Maggie Appleton Aesthetic Command Lines with Hyper, Spaceship, and Oh My Zsh Leaving Elicit July 2024 | Maggie Appleton A Short History of Bi-Directional Links The Pattern Language of Project Xanadu Assumed Audiences Ambient Co-presence
Illustrating Gatsby's Key Concepts
2020-08-20 · via Maggie Appleton

My previous website was built in a JavaScript framework called Gatsby.js . It’s one of a host of new website builders based around static site-generation and the JAMStack JAM stands for JavaScript, APIs, and Markup. It’s a relatively new approach to building websites that’s been gaining popularity over the last half decade. If you’ve heard of Gatsby before but haven’t wrapped your head around it yet, this might be for you.

I already have some illustrated notes up on using the JAMStack with Gatsby & Contentful

The JAMStack, Gatsby & Contentful

Illustrated notes on the JAMstack, Gatsby & Contentful and Building Gatsby Themes

The Art and Craft of Gatsby Themes

Illustrated notes on building Gatsby themes
, but they’re a little more advanced.

Khaled Garbaya put out an egghead course on Getting Started with Gatsby that’s better suited to Gatsby beginners.

I made a set of illustrations that capture the key concepts from Khaled’s course. They don’t summarise all the course content. They’re just supporting material that help clarify the most important ideas.

First up is a big picture view showing all the essential parts of a Gatsby site.

Gatsby is a collection of tools for building static sites

Gatsby sites are able to pull in data from multiple sources all at once. This includes REST API endpoints, classic content management systems like Wordpress or Contentful , or just your local file system.

These are pulled in through GraphQL , which acts as a transportation layer.

Node.js is the main engine inside a Gatsby site which generates the pages, nodes, and metadata.

And finally React creates all the user interface elements.

Page Queries vs. Static Queries

Once people wrap their heads around the structure of a Gatsby project, GraphQL is usually one the first sticking points.

If you’ve never worked with it before, the syntax looks very odd and it’s hard to tell what it’s doing.

It gets more confusing to learn there are two types of queries - page queries and static queries

Diagram of a pageQuery request inside a page, and a static query request inside a component

It only seems complex on the surface, but it’s easy to distinguish these two. Most of your queries will be page queries – these live inside your page files like blog.js or about.js

Static queries go inside individual component files like Navbar.js or Footer.js. There’s also a handy React hook to handle these for us: useStaticQuery

Progressive Enhancement

One of the main benefits of a Gatsby site is it uses a technique called Progressive Enhancement to render pages.

Animation of a page rendering static HTML elements first, then being updates with React afterwards

This is what makes Gatsby page look like they load quickly. The lightweight static HTML version appears first, and then heavier files and interactive elements are layered on afterwards.

React handles any changes and user interactions. Once an element is clicked or changed, React “ rehydrates ” the page.

These illustrations are part of the egghead community notes on Khaled’s Get Started with Gatsby course .

You can find more notes taken by people who have been through the course on there. If you take the course yourself, you can also add to them to the shared github repo .