Eleventy(11ty) logo Eleventy
The possum is Eleventy’s mascot
Eleventy 中文文档
Menu
Eleventy 5.81s
Gatsby 43.36s

#部署网站

Contents

现在你已经用 Eleventy 构建了一个网站了 (即使只有一个 HTML 页面!) ,并且已经准备好要把它放到网上让大家看看了!以下是各种部署网站的方式!

构建脚本 Jump to heading

当部署你用 Eleventy 构建的网站时,最终目的是将 编译出来的产物 (默认输出到 _site 目录) 上传到服务器上。你所用到的命令通常作为 构建脚本(build script) 配置在 package.json 文件中。如下所示:

Filename package.json
{
"scripts": {
"build": "npx @11ty/eleventy"
}
}

针对生产环境的构建 Jump to heading

标准的 Eleventy 构建是针对生产环境(production-ready)的。Eleventy 不会在内部针对开发和生产环境来改变其构建的行为。

但是,如果你想定制 Eleventy 来添加自己的优化的话,可以通过 环境变量 来实现。

网站托管商 Jump to heading

以下列表为你部署 Eleventy 项目提供一些思路。还有很多选项可供选择,不一而足。

Edit on the Web Jump to heading

There are some great Web editors popping up that you can use to run and edit Eleventy projects online! Here are some options:

相关内容 Jump to heading

来自社区的资源 Jump to heading

×51 resources courtesy of 11tybundle.dev curated by IndieWeb Avatar for https://www.bobmonsour.com/Bob Monsour

Expand to see 46 more resources.

Other pages in Getting Started: