Gatsby v2

使用 React 构建快速、现代的应用程序和网站。(Build blazing fast, modern apps and websites with React)

Github stars Tracking Chart

Gatsby v2

在所有重要的方面都快

Gatsby 是一个基于 React 的免费开源框架,它可以帮助开发者构建快速的网站和应用。

快速入门 · 教程 · 插件 · 入门 · 展示 · 贡献 · 支持: Twitter & Discord

Gatsby 是一个现代网络框架,用于制作速度极快的网站。

  • 超越静态网站。获得静态网站的所有好处,但没有任何限制。Gatsby 网站是功能齐全的 React 应用程序,因此您可以创建高质量的动态 Web 应用程序,从博客到电子商务网站再到用户仪表盘。
  • 为每个网站使用现代堆栈。无论数据来自哪里,Gatsby 网站都使用 React 和 GraphQL 构建。为您和您的团队构建统一的工作流程,无论数据是否来自同一个后端。
  • 从任何地方加载数据。Gatsby 可从任何数据源获取数据,无论是 Markdown 文件、Contentful 或 WordPress 等无头 CMS,还是 REST 或 GraphQL API。使用源插件加载数据,然后使用 Gatsby 的统一 GraphQL 接口进行开发。
  • 性能是天生的。默认情况下,您的性能审计将成为王牌。Gatsby 会自动进行代码分割、图像优化、内联关键样式、懒加载、预取资源等,以确保您的网站速度快 -- 无需手动调整。
  • 以分币为单位托管。Gatsby 网站不需要服务器,因此您可以在 CDN 上托管您的整个网站,而成本仅为服务器渲染网站的一小部分。许多 Gatsby 网站可以完全免费托管在 GitHub Pages 和 Netlify 等服务上。

了解如何在下一个项目中使用 Gatsby。

本文档中的内容

5 分钟就能启动并运行

通过以下四个步骤,您可以在 5 分钟内在本地开发环境中建立并运行一个新的 Gatsby 网站。

  1. 安装 Gatsby CLI。
    npm install -g gatsby-cli
            
  2. 从 Gatsby starter 创建 Gatsby 网站。只需一条命令就能设置好您的Gatsby博客:
    # create a new Gatsby site using the default starter
    gatsby new my-blazing-fast-site
            
  3. develop 模式启动网站。接下来,移动到你的新网站的目录中并启动它:
    cd my-blazing-fast-site/
    gatsby develop
            
  4. 打开源代码并开始编辑!你的网站现在运行在 http://localhost:8000。在你选择的代码编辑器中打开 my-blazing-fast-site 目录,编辑 src/pages/index.js 。保存您的更改,浏览器将实时更新!

此时,你已经有了一个功能齐全的 Gatsby 网站。有关如何定制 Gatsby 网站的其他信息,请参见我们的 插件官方教程

学习 Gatsby

Gatsby 的完整文档 在网站上

  • 对于大多数开发人员,我们建议从我们的 深入教程开始,用 Gatsby 创建一个网站y 它从零假设你的能力水平开始,贯穿过程的每一步。
  • 要直接进入代码示例,请访问 我们的文档 特别是,请查看侧边栏的 “指南”、“API 参考”、和 “高级教程” 部分。

我们欢迎大家对我们的文档提出改进建议。请参阅 "如何贡献" 文档了解更多细节。

开始学习 Gatsby:跟随教程 - 阅读文档

迁移指南

已经有一个 Gatsby 网站?这些方便的指南将帮助您将 Gatsby v2 的改进添加到您的网站,而无需从头开始。

行为守则

Gatsby 致力于建立一个温馨、多元、安全的社区。我们希望每个参与 Gatsby 社区的人都能遵守我们的行为准则。请阅读它。请遵守它。在 Gatsby 社区中,我们努力互相建设,共同创造惊人的事情。

如何贡献

无论你是在帮助我们修复 bug,改进文档,还是在传播这个词,我们都希望你能成为 Gatsby 社区的一部分!

查看我们的 贡献指南,了解关于贡献和设置步骤的想法,以使我们的版本库在您的本地机器上运行。

关于这个版本库是如何组织的一个说明

这个版本库是一个使用 Lerna 管理的 monorepo。这意味着在这个代码库中管理着 多个包,尽管我们将它们作为单独的包发布到 NPM。

为 Gatsby v1 贡献力量

目前我们只接受 Gatsby v1 的 BUG 修复,不接受新功能。

许可证

采用 MIT 授权

谢谢

感谢我们的许多贡献者和 Netlify 托管 Gatsby 和我们的示例站点。

(vz re-edited on 2020.12.20)

Overview

Name With Ownergatsbyjs/gatsby
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 13)
PlatformBSD, Cross-platform, Linux, Mac, Windows
License:MIT License
Release Count35981
Last Release Namegatsby-source-wordpress@7.13.3 (Posted on 2024-02-23 10:04:17)
First Release Namev0.0.1 (Posted on 2015-05-21 15:45:12)
Created At2015-05-21 22:43:05
Pushed At2024-03-23 06:35:42
Last Commit At2024-03-15 03:17:01
Stargazers Count55k
Watchers Count741
Fork Count10.4k
Commits Count21.6k
Has Issues Enabled
Issues Count14027
Issue Open Count164
Pull Requests Count18067
Pull Requests Open Count169
Pull Requests Close Count3855
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Gatsby is a modern web framework for blazing fast websites.

  • 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.

  • 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.

  • 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.

  • Performance Is Baked In. Ace your performance audits by default. Gatsby automates code
    splitting, image optimization, inlining critical styles, lazy-loading, and prefetching resources,
    and more to ensure your site is fast — no manual tuning required.

  • 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 services like GitHub Pages and Netlify.

Learn how to use Gatsby for your next project.

What’s In This Document

? Get Up and Running in 5 Minutes

You can get a new Gatsby site up and running on your local dev environment in 5 minutes with these four steps:

  1. Install the Gatsby CLI.

    npm install -g gatsby-cli
    
    
  2. Create a Gatsby site from a Gatsby starter.

    Get your Gatsby blog set up in a single command:

    # create a new Gatsby site using the default starter
    gatsby new my-blazing-fast-site
    
  3. Start the site in develop mode.

    Next, move into your new site’s directory and start it up:

    cd my-blazing-fast-site/
    gatsby develop
    
  4. Open the source code and start editing!

    Your site is now running at http://localhost:8000. Open the my-blazing-fast-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.

? Learning Gatsby

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 “Guides”, “API Reference”, and “Advanced Tutorials” 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

? Migration Guides

Already have a Gatsby site? These handy guides will help you add the improvements of Gatsby v2 to your site without starting from scratch!

❗ Code of Conduct

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. ??

? How to Contribute

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! :muscle::purple_heart:

Check out our Contributing Guide for ideas on contributing and setup steps for getting our repositories up and running on your local machine.

A note on how this repository is organized

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.

Contributing to Gatsby v1

We are currently only accepting bug fixes for Gatsby v1. No new features will be accepted.

:memo: License

Licensed under the MIT License.

? Thanks

Thanks to our many contributors and to Netlify for hosting gatsbyjs.org and our example sites.

To the top