EleventyStarter

11ty-project-base — Eleventy Starter Template

By gdewalters

A static site starter template built on Eleventy v3 and Tailwind CSS v4, including dark mode, 404/500 pages, JS bundling, and Netlify deployment configuration.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-13View source

What stands out

A quick read of the recorded project description.

01

Eleventy v3 (ESM) with a clear directory layout

02

Tailwind CSS v4 CLI, with tokens defined via @theme and Typography plugin integration

03

Dark mode toggle with no FOUC that respects operating system preference

04

Production HTML minification with html-minifier-terser, keeping XML/RSS safe

05

404 and 500 pages at the root path, with noindex and excluded from collections

06

JavaScript bundling via the esbuild context API, output to public/assets/js

Template Details

This template is an Eleventy v3 (ESM) static site starter project that processes styles with the Tailwind CSS v4 CLI and bundles JavaScript with esbuild. The README states that it includes a dark mode toggle (no FOUC, respects system preference), production HTML minification, 404 and 500 pages at the root path (with noindex), an optional SPA fallback (via _redirects or vercel.json), Netlify deployment configuration, and an aggregate development command npm run dev:all. The directory structure separates content, layouts, data, configuration, style source files, and script entry points.

For usage, the README provides three ways to create a new project from the template: the GitHub template interface, the GitHub CLI, and a shallow clone. After initialization, you need to update the package.json metadata, the site name in _data/site.js, the navigation links in base.njk, and replace the sample images. Development requires Node v20+, and the production build outputs to _site/. The deployment section uses Netlify as an example, giving the build command, publish directory, and Node version settings, and notes that the header configuration in netlify.toml is read automatically.

The README does not provide specifics on performance, accessibility compliance, browser compatibility ranges, or deployment steps for platforms other than Netlify. The template itself does not include a content management system or database integration; its positioning is a static site starter foundation.

Eleventystarter

Is it right for your project?

Use Cases

  • Quickly creating a new Eleventy static site project from the template
  • Starting a blog or documentation site that needs dark mode and a basic typographic theme
  • Static sites deployed with Netlify that want preconfigured build, header, and redirect settings
  • Static site projects that need an optional SPA fallback or custom redirects

Suitable For

  • Front-end developers familiar with Node.js and npm
  • Teams that want to build static sites with Eleventy and Tailwind CSS
  • Projects that need a customizable starter template rather than a full CMS

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Requires Node v20+ (see .nvmrc) and npm.

  2. 2

    After creating a new project via the GitHub template, GitHub CLI, or a shallow clone, run npm install and npm run dev:all.

  3. 3

    After initialization, update the package.json metadata, the site name in _data/site.js, the navigation links in base.njk, and replace the sample images.

  4. 4

    The production build uses npm run build:all and outputs to _site/.

  5. 5

    For Netlify deployment, set the build command to npm run build:all, the publish directory to _site, and the Node version to 20.

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the ISC license in the public repository; the free scope is the code of that version and does not mean external services or third-party assets are free.

Must comply with when using

  • Free to use, copy, modify, and distribute for any purpose, including commercial use.
  • All copies must retain the original copyright notice and license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses; the code's ISC license alone cannot determine this.
  • External services such as domains, hosting, databases, payments, or AI may incur separate charges.
  • Development and builds require Node.js v20 or higher (see .nvmrc); lower versions cannot run it.
  • The deployment example targets Netlify and requires connecting a Netlify account and configuring the build command and publish directory.
  • Enabling the SPA fallback (uncommenting /* /index.html 200) disables the static 404 page; the two cannot be used at the same time.
  • You cannot enable the SPA fallback and keep the static 404 page simultaneously; you must choose one.
  • GitHub Pages does not support rewrite rules; if you need to deploy an SPA, you must use the 404-as-SPA loader technique.
View Original Text Basis

for any purpose with or without fee is hereby granted

Original License Text

- Ensure Node **v20+** (run `nvm use` if you use `nvm`; see `.nvmrc`).

Original README

- Connect the new repo in Netlify.

Original README

- **Optional SPA**: uncomment `/* /index.html 200` to route all paths to the homepage (disables static 404).

Original README

> Do not enable SPA fallback **and** keep a static 404 at the same time. Pick one.

Original README

- **GitHub Pages**: no rewrites; use the “404‑as‑SPA loader” trick if you must ship an SPA.

Original README
https://github.com/gdewalters/11ty-project-base/blob/main/LICENCEhttps://github.com/gdewalters/11ty-project-base/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-13. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
Partly documented · 74 / 100
Technologies
Eleventy
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2025-09-02
Screenshot last checked
2026-10-13

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Eleventy as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: codex-user-requested-batch-review-20261015 · 2026-10-15

Inspect the recorded source material

SHA-256: a1315c52de62ee0ab5a3ac4826fd6a11002c47a215c0f2db7396127bf4567acb

2026-10-13T13:49:41.856Z

Source file / repository
# 11ty project base

A clean, future‑proof Eleventy v3 starter wired with Tailwind CSS v4, a tasteful prose theme, dark mode, smart minification, first‑class 404/500 pages, optional SPA fallback, and a one‑command dev workflow. Minimal ceremony, maximum mileage.

---

## Features

- **Eleventy v3 (ESM)** with a tidy directory layout  
- **Tailwind v4 (CLI)** with tokens via `@theme`, Typography plugin, and a tiny base prose theme  
- **Dark mode** toggle (no FOUC, respects OS preference)  
- **Minification in production** (`html-minifier-terser`), XML/RSS kept safe  
- **404 & 500 pages** at the site root; SEO‑safe `noindex`  
- **Optional SPA fallback** via `_redirects` (or `vercel.json`)  
- **JS bundling** via esbuild (context API), outputs to `public/assets/js`  
- **Netlify‑ready** (`netlify.toml` with headers + Node version)  
- **One command to rule them all**: `npm run dev:all`

---

## Using this starter for a new project

Spin up a fresh site from this starter in a brand-new directory. Pick the route that suits you:

### Option A — GitHub “Use this template” (UI)
1. Open this repo on GitHub and click **Use this template → Create a new repository**.
2. Name your new repo (e.g. `my-new-site`) and create it.
3. Clone it locally:
   ```bash
   git clone [email protected]:<YOUR-GH-USER>/my-new-site.git
   cd my-new-site
   npm install
   npm run dev:all
   ```

### Option B — GitHub CLI (from template)
Replace `OWNER/REPO` with this starter’s full name.
```bash
gh repo create my-new-site   --template OWNER/REPO   --public   --clone
cd my-new-site
npm install
npm run dev:all
```

### Option C — Shallow clone (no template UI)
```bash
git clone --depth=1 [email protected]:OWNER/REPO.git my-new-site
cd my-new-site
rm -rf .git
git init -b main
git add .
git commit -m "chore: bootstrap from starter"
# (optional) set up the remote:
# git remote add origin [email protected]:<YOUR-GH-USER>/my-new-site.git
# git push -u origin main
npm install
npm run dev:all
```

---

### Post-setup checklist (2 minutes)

- **Project metadata**
  - `package.json`: update `name`, `description`, `repository`, `author`, `homepage`, `bugs`.
  - `README.md`: change the short description to match the new site.
  - `LICENCE`: ensure the copyright holder/year suit this project.

- **Site identity**
  - `_data/site.js`: set your site `name` (and any other fields you add later).
  - `_includes/layouts/base.njk`: update header nav links (and email in 404/500).
  - Replace `public/assets/images/example.jpg` with a real image or remove it.

- **Dev & build**
  - Ensure Node **v20+** (run `nvm use` if you use `nvm`; see `.nvmrc`).
  - Dev: `npm run dev:all` → http://localhost:8080
  - Prod build: `npm run build:all` (outputs to `_site/`)

- **Deploy (Netlify)**
  - Connect the new repo in Netlify.
  - Build command: `npm run build:all`
  - Publish directory: `_site`
  - Node version: 20 (in **Site settings** or via `netlify.toml`).
  - `_redirects` and headers in `netlify.toml` are picked up automatically.

- **CI (GitHub Actions)**
  - The included workflow builds on pushes/PRs to `main`/`master`.
  - Check the **Actions** tab after your first push.

---

### Common tweaks
- Want a different container width? Adjust `.container-page` (and optionally add `.container-narrow`) in `styles/Tailwind.css`.
- Need extra colours or typography? Add tokens under `@theme` and style `.prose` as needed.
- Not using JS yet? Remove the `JS` process from `dev:all` or leave it—it’s harmless.

---

## Directory structure

```
11ty-project-base/
├─ _config/             # Eleventy hooks
│  ├─ filters.js
│  ├─ shortcodes.js
│  └─ transforms.js
├─ _data/               # Global data
│  ├─ env.js
│  └─ site.js
├─ _helpers/
│  └─ build-js.js       # esbuild bundler (context API)
├─ _includes/
│  └─ layouts/
│  |   └─ base.njk
│  └─ partials/
├─ content/             # Eleventy input
│  ├─ 404.njk
│  ├─ 500.njk
│  ├─ index.njk
│  └─ styles/
│     └─ main.css       # generated by Tailwind CLI (gitignored)
├─ public/              # passthrough to site root
│  ├─ _redirects        # optional
│  └─ assets/
│     └─ images/
│        └─ example.jpg
├─ scripts/             # your app JS entry(ies)
│  └─ main.js
├─ styles/
│  └─ Tailwind.css      # Tailwind v4 entry (source)
├─ _site/               # Eleventy output (gitignored)
├─ .gitignore
├─ .nvmrc
├─ eleventy.config.js
├─ netlify.toml
└─ package.json
```

---

## Requirements

- Node **v20+** (see `.nvmrc`)
- npm

---

## Quick start

```bash
npm install
npm run dev:all
# open http://localhost:8080
```

**Production build:**
```bash
npm run build:all
```

---

## NPM scripts

```json
{
  "scripts": {
    "dev": "ELEVENTY_ENV=dev eleventy --serve",
    "build": "ELEVENTY_ENV=prod eleventy",
    "clean": "rimraf _site",

    "tw:init": "tailwindcss -i styles/Tailwind.css -o content/styles/main.css",
    "tw:watch": "tailwindcss -i styles/Tailwind.css -o content/styles/main.css --watch",
    "tw:build": "tailwindcss -i styles/Tailwind.css -o content/styles/main.css --minify",

    "js:watch": "node _helpers/build-js.js --watch",
    "js:build": "node _helpers/build-js.js",

    "predev:all": "npm run tw:init",
    "dev:all": "concurrently -k -n ELEVENTY,TAILWIND,JS -c auto \"npm:dev\" \"npm:tw:watch\" \"npm:js:watch\"",
    "build:all": "npm run tw:build && npm run js:build && npm run build"
  }
}
```

- `dev:all` runs Eleventy + Tailwind watcher + esbuild watcher.  
- `build:all` compiles Tailwind, bundles JS, then builds Eleventy (with minification).

---

## Eleventy configuration

`eleventy.config.js`:
- **Input**: `content/`
- **Includes**: `_includes/`
- **Data**: `_data/`
- **Output**: `_site/`
- **Passthrough**: `public/` → `/`, `content/styles/` → `/assets` (so compiled CSS is served as `/assets/main.css`)
- **Watches**: `content/styles`, `styles`, `scripts`
- **Transforms**: registered from `_config/transforms.js`
- **Template engines**: Nunjucks for html/md/data

---

## Minification and XML safety

`_config/transforms.js` includes two transforms:

1. **`html-minify`** (prod only): uses `html-minifier-terser` for `.html?` files with safe defaults (`collapseWhitespace`, `removeComments`, `minifyJS/CSS`, etc.).  
2. **`xml-preserve`**: for `.xml`, `.rss`, `.atom`, `.xsl`, we **do not minify**; we only **normalise** newlines and trim trailing whitespace to keep feeds/sitemaps parser‑friendly.

Production mode is toggled by `ELEVENTY_ENV=prod` in the `build` script.

---

## Tailwind v4 setup

- Entry CSS: `styles/Tailwind.css`  
- Output CSS: `content/styles/main.css` (gitignored; copied to `/assets/main.css`)  
- Plugins: `@tailwindcss/typography`  
- Tokens: declared via `@theme` (e.g., `--color-vividcrimson`, `--color-huntergreen`)  
- Sources: `@import "tailwindcss" source("../content");` and `@source "../_includes";` to scan Eleventy templates.

### Base prose theme and links

- All links: subtle underline, medium weight, **crimson**; underline removed on hover/focus.  
- `.prose` content: neutral text, **muted hunter‑green** blockquotes (text + left border), sensible code/pre colours.

Apply to Markdown/CMS output by wrapping rendered HTML with `.prose` (e.g., on article containers or template partials).

---

## Dark mode (no FOUC + toggle)

- I set `<html data-theme="dark|light">` early via a tiny inline script in `base.njk` (uses `localStorage` or OS preference).  
- Dark tokens adjust link colour (brighter crimson), quote accents, prose neutrals, and card backgrounds.  
- A **“Toggle theme”** button in the header flips state and saves preference.

You can move the toggle script into `scripts/main.js` later if you prefer bundling.

---

## Header/footer layout

- Header/footer content is wrapped with `.container-page` (or `.container-narrow` if enabled) to align with main content.  
- Optional subtle backgrounds with dark‑mode variants to separate header/footer from main content.

---

## 404 & 500 pages

- `content/404.njk` → `/404.html`  
- `content/500.njk` → `/500.html`  
- Both use `noindex` and are excluded from collections.  
- Eleventy Dev Server routes unknown paths to `/404.html` locally.  
- Netlify/Vercel/Cloudflare Pages/GitHub Pages use `/404.html` automatically for static sites.

---

## Redirects & SPA fallback

- `public/_redirects` is passed through to the site root:  
  - Add custom redirects like `/old /new 301`.  
  - **Optional SPA**: uncomment `/* /index.html 200` to route all paths to the homepage (disables static 404).  
- **Vercel**: use `vercel.json` rewrites if you need SPA behaviour.  
- **GitHub Pages**: no rewrites; use the “404‑as‑SPA loader” trick if you must ship an SPA.

> Do not enable SPA fallback **and** keep a static 404 at the same time. Pick one.

---

## JavaScript bundling

- Entry: `scripts/main.js`  
- Bundler: `_helpers/build-js.js` uses **esbuild context API** for watching:  
  - Output: `public/assets/js/bundle.js` (passthrough to `_site/assets/js`)  
  - Include in layout: `<script src="/assets/js/bundle.js" defer></script>`

---

## Netlify deploy

`netlify.toml`:

```toml
[build]
  command = "npm run build:all"
  publish = "_site"

[build.environment]
  NODE_VERSION = "20"

[[headers]]
  for = "/assets/*"
  [headers.values]
    Cache-Control = "public, max-age=31536000, immutable"

[[headers]]
  for = "/*"
  [headers.values]
    Referrer-Policy = "strict-origin-when-cross-origin"
    X-Content-Type-Options = "nosniff"
    X-Frame-Options = "DENY"
```

- Netlify will also read `_redirects` from the published root.  
- If you convert to an SPA later, add a 200 rewrite here **or** in `_redirects` (not both).

---

## Global data

- `_data/site.js`: name/year for layout chrome.  
- `_data/env.js`: simple environment surface (`ELEVENTY_ENV`, Node version) for templates/data.

---

## Customising

- Add collections (e.g., `content/posts/`) and define them in `eleventy.config.js`.  
- Extend typography (e.g., `.prose-lg` sections) with component classes.  
- Add more filters/shortcodes in `_config/filters.js` and `_config/shortcodes.js`.  
- Replace the grid tiles on the homepage with your real sections.

---

## Troubleshooting

- **Passthrough collision**:  
  Error: “Multiple passthrough copy files are trying to write to the same output file (`_site/assets/main.css`).”  
  Fix: only passthrough **compiled** CSS (`content/styles` → `/assets`). Do **not** passthrough `styles/`.

- **esbuild “Invalid option 'watch'”**:  
  Use the **context API** (`const ctx = await esbuild.context(opts); await ctx.watch();`) as implemented in `_helpers/build-js.js`.

- **No CSS on first load**:  
  Ensure `predev:all` runs `tw:init` so `content/styles/main.css` exists before Eleventy starts.

- **SPA fallback eats 404**:  
  If you enable `/* /index.html 200`, you will not see your static 404. That’s expected.

- **Dark mode flashes**:  
  Make sure the inline theme bootstrap runs **before** the CSS link in `base.njk`.

---

## Licence

See [`LICENCE`](LICENCE).

---

## Credits

Built with Eleventy and Tailwind. Happy building!
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.

eleventy-base-blog

eleventy-base-blog

The officially maintained Eleventy blog starter template, MIT licensed, includes posts, tag pages, archives, an about page, a 404 page, an Atom feed, and sitemap.xml, with per-page CSS bundling, syntax highlighting, and image optimization.

Eleventy · Blog

eleventy-garden

eleventy-garden

An Eleventy-based digital garden starter template for building a personal knowledge site organized through hyperlinks. It supports Roam-style double-bracket links, backlink display, and hover cards for backlinks.

Eleventy · Starter

eleventastic

eleventastic

Eleventastic is an Eleventy starter kit by Max Böck, used as the base for new 11ty projects. It integrates Sass, Webpack, SVG icon sprites, critical CSS, and HTML minification into the 11ty build without external steps.

Eleventy · Starter

neat-starter

neat-starter

An Eleventy-based static site starter template integrating Netlify CMS, Alpine.js, and Tailwind CSS. It provides a ready-to-run example site, a one-click Netlify deploy button, and an MIT-licensed codebase.

Eleventy · Starter

Eleventy-Starter-Boilerplate

Eleventy-Starter-Boilerplate

An Eleventy-based blog starter template with Tailwind CSS, Webpack, PostCSS, ESLint, and Prettier, optional Netlify CMS, and built-in SEO metadata, sitemap, and 404 page.

Eleventy · Blog

eleventy-plus-vite

eleventy-plus-vite

A static site starter combining Eleventy and Vite, with a live-reloading development server, Vite-based production post-processing, a PostCSS pipeline with Autoprefixer and cssnano, critical CSS inlining and asynchronous CSS loading, a web font loading strategy example, fluid typography, basic dark mode, an…

Eleventy · Starter