Eleventy启动器

eleventy-starter-ghost — Eleventy 启动器模板

作者 anythingcodes

eleventy-starter-ghost 是一个基于 Eleventy 的静态站点启动器,把 Ghost 作为无头 CMS 拉取内容,生成完全静态的网站,并提供 Netlify 部署配置。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-02查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

以 Ghost 作为无头 CMS,Eleventy 在构建时拉取内容并输出完全静态的站点

02

默认从 https://eleventy.ghost.io 拉取示例内容,可通过 .env 中的 Content API 凭据切换到自己的 Ghost 实例

03

包含 netlify.toml、headers.njk、redirects.njk 三个 Netlify 部署配置文件,分别处理构建设置、安全响应头和重定向

04

可配合 Ghost 与 Netlify 的集成,用 deploy hook 在内容变化时触发重新构建

05

提供关闭 Ghost 默认主题前端并启用 noindex 的选项,让 Eleventy 前端成为 SEO 来源

模板详细介绍

该模板由 anythingcodes 发布在 GitHub,采用 MIT 许可。它的核心思路是把 Ghost 当作无头 CMS:Eleventy 在构建时从 Ghost 的 Content API 读取内容,输出完全静态的站点。默认情况下,模板会从 https://eleventy.ghost.io 这个 Ghost 实例拉取示例内容;要接入自己的站点,需要在 .env 配置文件中填写凭据,其中 contentApiKey 可在 Ghost 管理后台的 Integrations 页面获取。README 说明使用该模板需要 Ghost 版本不低于 2.10.0。

仓库包含三个面向 Netlify 的配置文件:netlify.toml 用于构建设置,headers.njk 生成默认安全响应头(输出到 /_headers),redirects.njk 用于设置自定义域名重定向(输出到 /_redirects)。部署到 Netlify 后,可以配置 Ghost 与 Netlify 的集成,通过 deploy hook 在 Ghost 内容变化时触发 Netlify 重新构建。

模板还提供一项优化选项:在 Ghost 设置中启用 “Make this site private” 标志,可以关闭 Ghost 默认的 Handlebars 主题前端,为 Ghost 实例加上密码保护,并输出 <meta name="robots" content="noindex" />,让 Eleventy 生成的前端成为 SEO 的唯一来源。

使用限制方面,模板依赖外部 Ghost 实例提供内容,需要自行准备 Ghost 站点和 Content API 凭据;演示图片、字体、图标等第三方素材的许可需单独核对,不能仅凭代码的 MIT 许可判断。

Eleventy启动器

适合你的项目吗?

适用场景

  • 用 Ghost 管理内容、但希望对外发布纯静态页面的站点
  • 把现有 Ghost 内容通过 Eleventy 构建为静态站点并部署到 Netlify
  • 需要为静态站点统一设置安全响应头和自定义域名重定向的项目

适合人群

  • 已经拥有 Ghost 实例并能获取 Content API 凭据的开发者
  • 使用 Eleventy 并计划部署到 Netlify 的静态站点项目
  • 希望内容编辑在 Ghost 后台完成、前端由静态构建生成的团队

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    克隆仓库后运行 yarn 安装依赖,使用 yarn start 启动开发服务器,yarn build 在本地构建站点

  2. 2

    编辑 .env 配置文件填入自己的 Ghost 凭据,contentApiKey 可在 Ghost 管理后台的 Integrations 页面获取

  3. 3

    README 说明使用该模板需要 Ghost 版本不低于 2.10.0

  4. 4

    部署到 Netlify 可使用仓库中的部署按钮,也可手动配置;Content API Key 通常直接写入 .env,若不想提交到仓库可改用 Netlify 环境变量

  5. 5

    如需让 Eleventy 前端成为 SEO 唯一来源,可在 Ghost 设置中启用 Make this site private 标志

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 默认从官方演示 Ghost 实例 https://eleventy.ghost.io 拉取内容,需自行替换为自己的实例。
  • 必须拥有自己的 Ghost 实例并在 Ghost 管理后台 Integrations 页面获取 contentApiKey,填入 .env 才能使用。
  • 要求 Ghost 版本不低于 2.10.0,低于该版本可能无法正常使用。
  • 部署依赖 Netlify 账户及平台服务,需自行注册并承担相应服务成本。
  • 自动重建需额外配置 Ghost 与 Netlify 的集成并使用 deploy hook,属于外部服务依赖。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

By default, the starter will populate content from a default Ghost install located at https://eleventy.ghost.io.

README 原文

To use your own install, edit the `.env` config file with your credentials. You can find your `contentApiKey` in the "Integrations" screen in Ghost Admin.

README 原文

The minimum required version for Ghost is `2.10.0` in order to use this starter without issues.

README 原文

To deploy to your Netlify account, hit the button below.

README 原文

you can set up a [Ghost + Netlify Integration](https://docs.ghost.org/integrations/netlify/) to use deploy hooks from Ghost to trigger Netlify rebuilds.

README 原文
https://github.com/anythingcodes/eleventy-starter-ghost/blob/master/LICENSEhttps://github.com/anythingcodes/eleventy-starter-ghost/blob/master/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料一般 · 68 / 100
技术栈
Eleventy
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2020-12-24
截图检查日期
2026-10-02

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Eleventy。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 41391bd8b968036bb6d1d81783c713f53e4872812e72d75d1281653383cb1c7f

2026-10-02T11:17:32.513Z

来源文件 / 仓库
# Eleventy Starter Ghost

A starter template to build completely static websites with [Ghost](https://ghost.org) & [Eleventy](https://www.11ty.io)

**Demo:** https://eleventy.ghost.org

![screenshot](https://user-images.githubusercontent.com/1177460/61880744-5b138980-aeed-11e9-9d8e-07c0b3c03cc5.png)

# Installing

```bash
# From Source
git clone https://github.com/TryGhost/eleventy-starter-ghost.git
cd eleventy-starter-ghost
```

Then install dependencies

```bash
yarn
```

# Running

Start the development server

```bash
yarn start
```

You now have a completely static site pulling content from Ghost running as a headless CMS.

By default, the starter will populate content from a default Ghost install located at https://eleventy.ghost.io.

To use your own install, edit the `.env` config file with your credentials. You can find your `contentApiKey` in the "Integrations" screen in Ghost Admin. The minimum required version for Ghost is `2.10.0` in order to use this starter without issues.

# Deploying with Netlify

The starter contains three config files specifically for deploying with Netlify. A `netlify.toml` file for build settings, a `headers.njk` file with default security headers set for all routes (builds to `/_headers` path), and `redirects.njk` to set Netlify custom domain redirects (builds to `/_redirects` path).

To deploy to your Netlify account, hit the button below.

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/TryGhost/eleventy-starter-ghost)

Content API Keys are generally not considered to be sensitive information, they exist so that they can be changed in the event of abuse; so most people commit it directly to their `.env` config file. If you prefer to keep this information out of your repository you can remove this config and set [Netlify ENV variables](https://www.netlify.com/docs/continuous-deployment/#build-environment-variables) for production builds instead.

Once deployed, you can set up a [Ghost + Netlify Integration](https://docs.ghost.org/integrations/netlify/) to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes in Ghost, your site will rebuild on Netlify.

# Optimising

You can disable the default Ghost Handlebars Theme front-end by enabling the `Make this site private` flag within your Ghost settings. This enables password protection in front of the Ghost install and sets `<meta name="robots" content="noindex" />` so your Eleventy front-end becomes the source of truth for SEO.

# Extra options

```bash
# Build the site locally
yarn build
```

# Copyright & License

Copyright (c) 2013-2020 Ghost Foundation - Released under the [MIT license](LICENSE).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。