Menu
Eleventy
1.93s
Astro
22.90s
#部署网站
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 项目提供一些思路。还有很多选项可供选择,不一而足。
使用命令行工具部署网站 Jump to heading
许多网站托管商提供了命令行工具来部署网站。下面列出几个:
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
GitHub Pages Tutorial by
Jonathan Snook- GitLab Pages Sample Project by Benson Muite
Azure Static Web Apps Tutorial by
Chad Schulz
Hosting Eleventy on GitHub Pages by
Quinn Dombrowski
Deploying Eleventy using Buddy CI/CD by
Maciek Palmowski
- GitHub Action for Eleventy by
@TartanLlama