Eleventy启动器

eleventy-folio — Eleventy 启动器模板

作者 tepiton

基于 Eleventy 的分章节文学站点启动器,提供章节排序、上一章/下一章导航与可移植的 content 目录。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

采集于 2026-09-30查看来源

值得关注的模板亮点

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

01

章节按 order 字段排序,缺失时回退为 999,再按文件名排序

02

章节页自带编号页眉与上一章/下一章导航,目录自动生成

03

content/ 目录自包含,可在 eleventy-pamphlet、eleventy-chapbook、eleventy-folio 之间迁移

04

删除 content/chapters/ 即可切换为单页作品模式

05

颜色与字体通过 css/index.css 顶部的 CSS 自定义属性集中调整

06

内置 GitHub Pages 工作流,推送 main 时自动构建部署并检测路径前缀

模板详细介绍

eleventy-folio 是一个面向分章节文学作品的 Eleventy 启动器,仓库描述为“chaptered literary sites”。它属于一组可互操作的模板(eleventy-pamphlet、eleventy-chapbook、eleventy-folio),三者共用同一个 content/ 目录结构,更换模板即可改变呈现方式而无需改动内容。

模板默认提供首页、关于页与章节页三类页面。章节文件放在 content/chapters/ 下,通过 front matter 中的 order 控制目录与上一章/下一章导航的排序(缺失时回退为 999,再按文件名排序以保证确定性),可选的 dek 字段用于在目录中显示一行副标题。章节页带编号页眉和前后章导航。若作品只有单页,删除 content/chapters/ 目录即可,index.md 会成为整部作品并继承基础布局,不再有章节导航与目录。

站点元数据集中在 content/_data/metadata.js,包含标题、副标题、URL、语言、描述与作者信息;这样 content/ 目录保持自包含,便于在三个模板之间迁移。外观通过 css/index.css 顶部的 CSS 自定义属性控制,包括背景、纸张、正文、次要文字、分隔线与强调色,以及正文字体与标题字体的字体栈。模板默认引用 Adobe Fonts 的 p22-stickley-pro-text 与 neue-kabel,kit ID 写在 _includes/layouts/base.njk 中,替换字体需同时修改该文件与 CSS 变量。

开发使用 npm run start 在 localhost:8084 启动带实时刷新的开发服务器,npm run build 输出到 _site/,npm run debug 带 Eleventy 调试输出。仓库包含 .github/workflows/pages.yml,在推送到 main 时构建并部署到 GitHub Pages,并会检测仓库名自动设置路径前缀。

限制方面:模板未在资料中说明对第三方字体、图片等素材的授权情况,这些素材需按各自许可单独核对;代码采用 MIT 许可,允许使用、修改、商用与分发,但分发时需保留版权与许可声明。

Eleventy启动器

适合你的项目吗?

适用场景

  • 搭建按章节组织、需要目录与前后章导航的连载文学作品站点
  • 制作只有单页正文的短篇作品站点,并复用同一套版式
  • 在多个 Eleventy 文学模板之间切换呈现方式而保留同一份内容
  • 通过修改 CSS 自定义属性快速更换配色与字体,形成不同的阅读外观

适合人群

  • 需要分章节发布并带目录导航的文学类站点作者
  • 希望内容与呈现分离、便于更换模板的 Eleventy 使用者
  • 接受使用 Adobe Fonts 或愿意自行替换字体来源的前端开发者

上手与定制指南

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

  1. 1

    克隆仓库后执行 npm install,再用 npm run start 在 localhost:8084 预览

  2. 2

    站点标题、副标题、URL、语言、描述与作者信息在 content/_data/metadata.js 中修改

  3. 3

    章节文件放入 content/chapters/,front matter 需包含 title 与 order,dek 可选

  4. 4

    默认字体来自 Adobe Fonts,kit ID 位于 _includes/layouts/base.njk,替换字体需同步更新 CSS 变量

  5. 5

    npm run build 输出到 _site/;推送到 main 会触发 .github/workflows/pages.yml 部署到 GitHub Pages

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 模板默认字体来自 Adobe Fonts(Typekit),需使用 Adobe Fonts 服务及其 kit ID;若未订阅或更换字体,需自行替换 base.njk 中的 Typekit 链接并更新 CSS 字体变量。
  • 内置部署工作流依赖 GitHub Pages 服务,推送到 main 分支时触发构建与部署;使用其他托管方式需自行调整或移除该工作流。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

This template uses `p22-stickley-pro-text` and `neue-kabel` from Adobe Fonts. The kit IDs are baked into `_includes/layouts/base.njk`.

README 原文

The included `.github/workflows/pages.yml` builds and deploys to GitHub Pages on push to `main`.

README 原文
https://github.com/tepiton/eleventy-folio/blob/main/LICENSEhttps://github.com/tepiton/eleventy-folio/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

记录的仓库更新时间
2026-09-12
截图检查日期
2026-10-01

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 7589bf8995909a59b845f9ed06375e4e7ef067396f92747a4c393bb9bd60dd91

2026-10-01T15:18:05.924Z

来源文件 / 仓库
# eleventy-folio

An Eleventy v3 starter for chaptered literary sites. Polished defaults, extra features.

Part of a family of interoperable templates:
- **eleventy-pamphlet** - minimal, single layout
- **eleventy-chapbook** - separate layouts, feature-rich
- **eleventy-folio** (this) - polished, with extras

The `content/` directory is portable across all three. Swap templates to change the presentation without touching your content.

## Quick start

```
git clone <this-repo> my-project
cd my-project
npm install
npm run start
```

Then open `http://localhost:8084`.

## Customization

### Site metadata

Edit `content/_data/metadata.js`:

```js
export default {
  title: "Your Literary Work",
  subtitle: "A subtitle or tagline",
  url: "https://example.com/",
  language: "en",
  description: "A description of this work.",
  author: {
    name: "Your Name",
    email: "[email protected]",
    url: "https://example.com/"
  }
}
```

Note: `metadata.js` lives inside `content/_data/` so the entire `content/` directory is self-contained and portable.

### Single-page vs multi-chapter

**Multi-chapter works:** Add files to `content/chapters/`. Each needs front matter:

```yaml
---
title: The Title of This Chapter
order: 1
dek: Optional one-line subtitle shown in the TOC
---
```

- `order` controls sort order in the TOC and prev/next navigation
- `dek` is optional
- Filename determines the URL: `01-threshold.md` → `/chapters/01-threshold/`
- Chapter pages get a numbered header and prev/next navigation

**Chapter sorting:** Chapters are sorted by `order` property (ascending, fallback to 999 if missing), then by filename alphabetically for determinism.

**Single-page works:** Delete the `content/chapters/` directory entirely. Your `index.md` becomes the whole work. It inherits the base layout with no chapter navigation or TOC.

### Home page

Edit `content/index.md`. The chapter list is generated automatically.

### About page

Edit `content/about.md`.

### Fonts, colors, and styles

Colors are CSS custom properties at the top of `css/index.css`:

```css
:root {
  --bg: #faf6ee;      /* page background */
  --paper: #fffdf8;   /* main content column */
  --ink: #1c1a18;     /* body text */
  --muted: #6d685f;   /* secondary text, captions */
  --rule: #d6d0c6;    /* borders and dividers */
  --accent: #8d3f2b;  /* links */
}
```

Change any of these to retheme the site without touching the rest of the stylesheet.

**Body font:** The body font stack uses CSS custom properties in `css/index.css`:

```css
:root {
  --font-body: p22-stickley-pro-text, neue-kabel, Palatino, Georgia, serif;
  --font-heading: neue-kabel, 'Gill Sans', 'Helvetica Neue', sans-serif;
}
```

**Adobe Fonts (Typekit):** This template uses `p22-stickley-pro-text` and `neue-kabel` from Adobe Fonts. The kit IDs are baked into `_includes/layouts/base.njk`. To use different fonts, replace the Typekit `<link>` tags and update the CSS variables.

**Other web fonts:** Add a `<link>` to your font provider in `_includes/layouts/base.njk` and update the `--font-body` and `--font-heading` variables in `css/index.css` to match.

## Project structure

```
content/
  _data/
    metadata.js          # Title, subtitle, author, URL
  index.md               # Home page
  about.md               # About / colophon
  chapters/
    chapters.11tydata.js # Layout for all chapters
    01-threshold.md
    02-orchard.md
    ...
_includes/
  layouts/
    base.njk             # HTML shell
    home.njk             # Home page layout
    chapter.njk          # Chapter layout with prev/next
css/
  index.css              # All styles
```

The `content/` directory is designed to be portable. Copy it to eleventy-pamphlet or eleventy-chapbook to get a different presentation with the same content.

## npm scripts

| Command | Description |
|:--------|:------------|
| `npm run start` | Dev server at `localhost:8084` with live reload |
| `npm run build` | Production build to `_site/` |
| `npm run debug` | Build with Eleventy debug output |

## Deploy

The included `.github/workflows/pages.yml` builds and deploys to GitHub Pages on push to `main`. No configuration needed for custom domains — the workflow detects the repo name and sets the path prefix automatically.
反馈内容错误

看看同类模板

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