Eleventy启动器

eleventy-pamphlet — Eleventy 启动器模板

作者 tepiton

基于 Eleventy 的短篇文学作品站点启动器,用两个布局承载中篇小说、单卷小说或小册子的章节与单页内容。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

仅两个布局:base.njk 页面外壳与 chapter.njk 章节包装,结构极简

02

章节按 content/chapters/ 目录自动识别,order 字段控制顺序,文件名决定 URL

03

单页作品可删除 chapters 目录,index.md 直接作为整部作品

04

content/ 目录可移植到同系列 eleventy-chapbook、eleventy-folio,内容不变只换呈现

05

css/ 下提供 style.css 与 utilitarian.css 两套样式,通过 metadata.js 的 stylesheet 字段切换

06

附带 GitHub Pages 部署工作流,推送 main 分支自动构建部署

模板详细介绍

eleventy-pamphlet 是一个面向短篇文学作品的 Eleventy 启动器,适合中篇小说、单卷小说和小册子这类篇幅有限、结构简单的出版形态。模板采用极简结构,只提供两个布局:base.njk 作为全站页面外壳,chapter.njk 为章节页提供编号标题与上一章/下一章导航。

内容组织上,多章节作品把 Markdown 文件放进 content/chapters/,通过 front matter 中的 order 字段控制章节顺序,文件名决定 URL;单页作品则直接删除 chapters 目录,让 index.md 成为整部作品。站点元数据放在 content/_data/metadata.js,整个 content/ 目录被设计为可移植,可整体复制到同系列的 eleventy-chapbook 或 eleventy-folio 中,在不改动内容的情况下更换呈现方式。

样式方面,css/ 下附带两套共用选择器契约的样式表:默认的 style.css 采用文学风格排版,utilitarian.css 使用 Helvetica 字体栈和更宽的页面。切换方式是在 metadata.js 中设置 stylesheet 字段,默认样式表会加载 Adobe Fonts 的 Typekit 字体,utilitarian 则跳过该加载。字体、颜色、链接色等直接在 css/style.css 中修改。

模板提供 start、build、clean、debug 四个 npm 脚本,并附带 GitHub Pages 部署工作流,推送到 main 分支时自动构建部署,自定义域名无需额外配置路径前缀。

限制方面:模板只包含两个布局,不提供搜索、分页列表、评论等扩展功能;章节排序依赖 order 字段,缺失时回退为 999 再按文件名排序。演示中使用的 Adobe Fonts 字体、图片等第三方素材需按各自许可单独核对。

Eleventy启动器

适合你的项目吗?

适用场景

  • 发布中篇小说或单卷小说,需要按章节顺序组织并带上一章/下一章导航
  • 制作篇幅较短的单页文学作品,如小册子、短篇或前言式页面
  • 在同一套内容基础上,通过更换同系列模板改变站点外观
  • 为文学类作品搭建带作者介绍页和 404 页的静态站点
  • 使用 GitHub Pages 托管并自动部署文学作品站点

适合人群

  • 需要极简结构、只关注正文排版的短篇文学作者
  • 希望内容与呈现分离、便于迁移到其他模板的写作者
  • 接受手动编辑 CSS 与 metadata.js 来调整站点外观的用户
  • 使用 GitHub Pages 部署静态站点的个人项目

上手与定制指南

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

  1. 1

    克隆仓库后执行 npm install,再运行 npm run start,开发服务器位于 localhost:8086

  2. 2

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

  3. 3

    多章节作品在 content/chapters/ 添加 Markdown 文件并填写 title 与 order;单页作品删除该目录

  4. 4

    默认样式使用 Adobe Fonts 的 Typekit 字体,替换字体需修改 _includes/layouts/base.njk 中的链接与 CSS 变量

  5. 5

    推送到 main 分支会触发 .github/workflows/pages.yml 自动构建并部署到 GitHub Pages

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 默认样式依赖 Adobe Fonts(Typekit)的 p22-stickley-pro-text 与 neue-kabel 字体,需使用 Adobe Fonts 服务及对应 kit;这些字体为第三方授权素材,不随 MIT 代码许可一并授予,商用或替换前须自行确认字体许可。
  • 仅默认样式表会加载 Typekit 网络字体;切换到 utilitarian 样式表则不加载。若无法使用 Adobe Fonts,需改用其他字体或选择 utilitarian 样式。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 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 Typekit webfont load is tied to the switch: the default stylesheet loads it, `utilitarian` skips it.

README 原文
https://github.com/tepiton/eleventy-pamphlet/blob/main/LICENSEhttps://github.com/tepiton/eleventy-pamphlet/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-27
截图检查日期
2026-10-01

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 71daa760ab31503ad6079dabdc1286b07cbb2cd8517eb6d95ec39d2d2a755e52

2026-10-01T14:33:10.475Z

来源文件 / 仓库
# eleventy-pamphlet

An Eleventy v3 starter for short literary works: novellas, single-volume fiction, pamphlets. Minimal structure with two layouts.

Part of a family of interoperable templates:
- **eleventy-pamphlet** (this) - minimal, single layout
- **eleventy-chapbook** - separate layouts, feature-rich
- **eleventy-folio** - 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:8086`.

## Customization

### Site metadata

Edit `content/_data/metadata.js`:

```js
export default {
  title: "My Literary Work",
  url: "https://example.com/",
  language: "en",
  description: "A description of this literary work",
  author: {
    name: "Your Name",
    email: "[email protected]",
    url: "https://example.com/"
  },
  image: "/img/cover.png",
  twitter: "@yourhandle"
}
```

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: Chapter One
order: 1
---
```

- `order` controls chapter sequence
- Filename determines the URL: `chapter-1.md` → `/chapters/chapter-1/`
- Chapters are detected automatically by location - no tag or flag needed
- 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.

### Home page

Edit `content/index.md`. Put your title page, foreword, or opening here.

### About page

Edit `content/about.md`.

### Fonts, colors, and styles

Fonts and colors are set directly in `css/style.css`. The main values to change:

```css
body {
  background-color: #fffff8;  /* page background */
  color: #111;                /* body text */
  font-family: Palatino, Georgia, serif;  /* body font */
}

h1, h2, h3 {
  font-family: 'Gill Sans', 'Helvetica Neue', sans-serif;  /* heading font */
}

a {
  color: #555;  /* link color */
}
```

**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 `style.css`.

### Stylesheet themes

Two stylesheets ship in `css/`, on the same selector contract:

| Stylesheet | Look |
|:-----------|:-----|
| `style.css` (default) | Literary: Stickley/Kabel webfonts, narrow 48ch column, centered headings |
| `utilitarian.css` | Plain Helvetica stack, wide page with a narrow prose measure, left-aligned, styled tables |

Switch by setting one key in `content/_data/metadata.js` (a content edit — no layout changes):

```js
stylesheet: "utilitarian",
```

The Typekit webfont load is tied to the switch: the default stylesheet loads it, `utilitarian` skips it. Any other value loads `/css/<value>.css`, so a site can ship its own stylesheet file and select it the same way.

### Typography classes

- `.drop` — drop cap on first letter, small caps on first line
- `.first-line` — small caps on first line only

```html
<p class="drop">This paragraph has a drop cap.</p>
```

## Project structure

```
content/
  _data/
    metadata.js          # Title, author, URL, social info
  chapters/
    chapter-1.md
    chapter-2.md
    ...
  content.11tydata.js    # Default layout for all content
  index.md               # Home / title page
  about.md               # About the author
  404.md                 # Not found page
css/
  style.css              # All styles
_includes/
  layouts/
    base.njk             # Shell for all pages
    chapter.njk          # Chapter wrapper with prev/next
```

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

## npm scripts

| Command | Description |
|:--------|:------------|
| `npm run start` | Dev server at `localhost:8086` with live reload |
| `npm run build` | Production build to `_site/` |
| `npm run clean` | Remove `_site/` |
| `npm run debug` | Build with full 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.
反馈内容错误

看看同类模板

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