gatsby, vitepress, and vuepress are Static Site Generators (SSG) that pre-render content into HTML for fast load times and SEO. gatsby is built on React and uses GraphQL to unify data sources, making it powerful for complex sites. vitepress and vuepress are built on Vue.js, focusing on documentation and content sites. vitepress is the newer, faster tool optimized specifically for docs, while vuepress offers more flexibility for general-purpose static sites within the Vue ecosystem.
gatsby, vitepress, and vuepress are all tools designed to turn content into static websites. They share the goal of improving performance and SEO by generating HTML at build time. However, they differ in framework choice, data handling, and intended use cases. Let's compare how they tackle common engineering challenges.
gatsby is built on React.
// gatsby: React Component
import React from "react";
export default function Home() {
return <h1>Welcome to Gatsby</h1>;
}
vitepress is built on Vue 3.
<!-- vitepress: Vue Component -->
<template>
<h1>Welcome to VitePress</h1>
</template>
vuepress is built on Vue.
<!-- vuepress: Vue Component -->
<template>
<h1>Welcome to VuePress</h1>
</template>
gatsby uses a GraphQL data layer.
// gatsby: GraphQL Query in Page
export const query = graphql`
query {
site { siteMetadata { title } }
}
`;
vitepress uses Frontmatter and JS.
<!-- vitepress: Markdown Frontmatter -->
---
title: Home
description: Welcome page
---
vuepress uses Frontmatter and JS.
<!-- vuepress: Markdown Frontmatter -->
---
title: Home
layout: Layout
---
gatsby uses gatsby-config.js.
// gatsby: gatsby-config.js
module.exports = {
plugins: [`gatsby-plugin-react-helmet`]
};
vitepress uses .vitepress/config.js.
// vitepress: .vitepress/config.js
export default {
title: "My Docs",
themeConfig: { nav: [] }
};
vuepress uses .vuepress/config.js.
// vuepress: .vuepress/config.js
export default {
title: "My Site",
bundler: "@vuepress/bundler-vite"
};
gatsby supports Theme Composition.
// gatsby: Shadowing a Component
// Create file at src/gatsby-theme-blog/components/bio.js
// This overrides the default theme bio component
vitepress uses Config-Based Theming.
// vitepress: Config Theming
export default {
themeConfig: {
logo: "/logo.png",
socialLinks: [{ icon: "github", link: "..." }]
}
};
vuepress uses Theme Packages.
// vuepress: Custom Theme
// .vuepress/theme/index.js
module.exports = {
extend: "@vuepress/theme-default"
};
gatsby can be slower on large sites.
# gatsby: Build Command
gatsby build
# Supports --incremental flag for faster rebuilds
vitepress is extremely fast.
# vitepress: Build Command
vitepress build
# Leverages Vite's optimized bundling
vuepress is moderate speed.
# vuepress: Build Command
vuepress build
# Speed depends on bundler choice (Vite vs Webpack)
While the differences are clear, all three tools share core SSG concepts.
<!-- All: Markdown with Components -->
# Title
<CustomComponent />
# All: File Structure
index.md -> /
about.md -> /about
# All: Deploy Output
# Dist folder contains static assets ready for CDN
| Feature | gatsby | vitepress | vuepress |
|---|---|---|---|
| Framework | βοΈ React | π’ Vue 3 | π’ Vue |
| Data Layer | πΈοΈ GraphQL | π Frontmatter | π Frontmatter |
| Config | βοΈ Complex | π Simple | βοΈ Moderate |
| Speed | π’ Moderate | π Very Fast | π Fast (v2) |
| Best For | π Complex Sites | π Documentation | ποΈ Custom Sites |
gatsby is the heavy lifter ποΈ β perfect for complex React applications needing data from many places. It requires more setup but scales well for marketing and e-commerce.
vitepress is the speedster ποΈ β built for documentation that needs to load instantly. It is the top choice for Vue projects needing docs.
vuepress is the customizer π¨ β a middle ground for Vue sites that need more control than VitePress offers without the complexity of Gatsby.
Final Thought: Pick gatsby for React data needs, vitepress for Vue docs, and vuepress for custom Vue sites.
Choose gatsby if your team uses React and you need to pull data from multiple sources like CMSs, APIs, or databases. It is best for marketing sites, blogs, and e-commerce where complex data relationships matter. Be prepared for a steeper learning curve due to its GraphQL layer.
Choose vitepress if you are building documentation for a Vue project or need a blazing fast, opinionated docs site. It is the default recommendation for Vue teams today. It sacrifices some flexibility for speed and simplicity.
Choose vuepress if you need a Vue-based SSG with more customization options than vitepress allows. It is suitable for content sites that require specific plugins or layouts not available in vitepress. Note that for pure documentation, vitepress is often preferred.
The future of web development is here.
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.
It combines the control and scalability of dynamically rendered sites with the speed of static-site generation, creating a whole new web of possibilities.
Gatsby helps professional developers efficiently create maintainable, highly-performant, content-rich websites.
Load Data From Anywhere. Gatsby pulls in data from any data source, whether itβs Markdown files, a headless CMS like Contentful or WordPress, or a REST or GraphQL API. Use source plugins to load your data, then develop using Gatsbyβs uniform GraphQL interface.
Go Beyond Static Websites. Get all the benefits of static websites with none of the limitations. Gatsby sites are fully functional React apps, so you can create high-quality, dynamic web apps, from blogs to e-commerce sites to user dashboards.
Choose your Rendering Options. You can choose alternative rendering options, namely Deferred Static Generation (DSG) and Server-Side Rendering (SSR), in addition to Static Site Generation (SSG) β on a per-page basis. This type of granular control allows you to optimize for performance and productivity without sacrificing one for the other.
Performance Is Baked In. Ace your performance audits by default. Gatsby automates code splitting, image optimization, inlining critical styles, lazy-loading, prefetching resources, and more to ensure your site is fast β no manual tuning required.
Use a Modern Stack for Every Site. No matter where the data comes from, Gatsby sites are built using React and GraphQL. Build a uniform workflow for you and your team, regardless of whether the data is coming from the same backend.
Host at Scale for Pennies. Gatsby sites donβt require servers, so you can host your entire site on a CDN for a fraction of the cost of a server-rendered site. Many Gatsby sites can be hosted entirely free on Gatsby Cloud and other similar services.
Use Gatsby's Centralized Data Layer Everywhere. With Gatsby's Valhalla Content Hub you can bring Gatsby's data layer to any project. Making it accessible via a unified GraphQL API for building content sites, eCommerce platforms, and both native and web applications.
Learn how to use Gatsby for your next project.
Click the link below to quickly try the workflow of developing, building, and deploying websites with Gatsby and Gatsby Cloud.
At the end of this process, you'll have
You can get a new Gatsby site up and running on your local dev environment in 5 minutes with these four steps:
Initialize a new project.
npm init gatsby
Give it the name "My Gatsby Site".
Start the site in develop mode.
Next, move into your new siteβs directory and start it up:
cd my-gatsby-site/
npm run develop
Open the source code and start editing!
Your site is now running at http://localhost:8000. Open the my-gatsby-site directory in your code editor of choice and edit src/pages/index.js. Save your changes, and the browser will update in real time!
At this point, youβve got a fully functional Gatsby website. For additional information on how you can customize your Gatsby site, see our plugins and the official tutorial.
Full documentation for Gatsby lives on the website.
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
To dive straight into code samples head to our documentation. In particular, check out the βHow-to Guidesβ, βReferenceβ, and βConceptual Guidesβ sections in the sidebar.
We welcome suggestions for improving our docs. See the βhow to contributeβ documentation for more details.
Start Learning Gatsby: Follow the Tutorial Β· Read the Docs
Wondering what we've shipped recently? Check out our release notes for key highlights, performance improvements, new features, and notable bugfixes.
Also, read our documentation on version support to understand our plans for each version of Gatsby.
Already have a Gatsby site? These handy guides will help you add the improvements of Gatsby v5 to your site without starting from scratch!
Gatsby is dedicated to building a welcoming, diverse, safe community. We expect everyone participating in the Gatsby community to abide by our Code of Conduct. Please read it. Please follow it. In the Gatsby community, we work hard to build each other up and create amazing things together. πͺπ
Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Gatsby community!
Check out our Contributing Guide for ideas on contributing and setup steps for getting our repositories up and running on your local machine.
This repository is a monorepo managed using Lerna. This means there are multiple packages managed in this codebase, even though we publish them to NPM as separate packages.
Licensed under the MIT License.
Thanks go out to all our many contributors creating plugins, starters, videos, and blog posts. And a special appreciation for our community members helping with issues and PRs, or answering questions on GitHub Discussions.
A big part of what makes Gatsby great is each and every one of you in the community. Your contributions enrich the Gatsby experience and make it better every day.