freeCodeCamp/guide/chinese/gatsbyjs/index.md

22 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Gatsby.js
localeTitle: Gatsby.js
---
## Gatsby.js
Gatsby是[React](https://guide.freecodecamp.org/react)的静态站点生成器,由[GraphQL](https://graphql.org/)提供[支持](https://graphql.org/) 。
Gatsby环境提供了几个“启动器”来帮助快速配置静态站点。 [初学者](https://www.gatsbyjs.org/starters/)可以在这里找到: [入门图书馆](https://www.gatsbyjs.org/starters/) 。
### 安装和使用Gatsby CLI
* 节点: `npm install --global gatsby-cli`
* 开始使用Gatsby官方首发 `gatsby new gatsby-site https://github.com/gatsbyjs/gatsby-starter-default`
* 之后更改为新创建的目录`cd gatsby-site`
* `gatsby develop`启动了一个热重载开发服务器。当保存`src/pages`更改时,将重新加载该站点。
* 要生成静态HTML页面请使用`gatsby build`
* `gatsby serve`将启动一个本地服务器,它将显示您构建的站点。
#### 更多信息:
有关教程和更多信息请查看Gatsby.js官方网站 [Gatsby.js官方网站](https://www.gatsbyjs.org/tutorial/)