A simple static site generator, inspired by Grav, Astro and Eleventy.
PeaPress takes Markdown files with YAML frontmatter as content, renders
them through Nunjucks templates with layouts, and outputs clean static
HTML into dist/.
- 📝 Markdown content with YAML frontmatter (
title,date,slug,tags, …) - 🧩 Nunjucks templates with layout inheritance (
{% extends %}) - 📚 Collections — group posts by frontmatter or directory (e.g.
/blog/) - ⚡ Clean static output with pretty URLs (
/blog/hello-world/→dist/blog/hello-world/index.html) - 🔁 Watch mode with dev server
- 🎨 Static asset copying (
static/orsrc/assets/)
# Install dependencies
npm install
# Build the site
node peapress.js build
# Or use the npm scripts
npm run build
# Watch + dev server
node peapress.js devThe generated site is in dist/. Any static host (Netlify, Vercel, GitHub
Pages, S3, Apache, nginx…) can serve it.
Create Markdown files anywhere under src/ (or content/, pages/, posts/):
---
title: My Post
date: 2026-01-15
slug: /blog/my-post/
collection: posts
tags: [demo]
---
# Hello
Write **Markdown** here. HTML is allowed too.slug/url/permalinkcontrol the output URL.collectiongroups content (defaults to the parent folder name).- Listing pages use
template: listand iterate over a collection.
Templates live in templates/ and use Nunjucks. base.njk is the HTML shell
with {% block content %} etc. Page templates extend it:
{% extends "base.njk" %}
{% block content %}
{{ content | safe }}
{% endblock %}Set layout or template in frontmatter to pick a template:
layout: post→ usestemplates/post.njktemplate: list→ usestemplates/list.njk
Add JSON/YAML data files in src/_data/:
src/_data/site.json→ global site data (site.title,site.author, …)- Any other file groups data by name (e.g.
_data/blog.json→blog).
peapress.js # CLI entry
lib/
builder.js # scan → parse → render → write
parser.js # frontmatter + markdown
renderer.js # nunjucks rendering
config.js # site configuration
dev-server.js # watch + serve
templates/ # nunjucks templates
src/ # content + _data
index.md
about.md
blog/
_data/site.json
static/ # static assets (css, images…)
dist/ # generated output (gitignored)
peapress build [dir] # build the site
peapress dev [dir] # watch + dev server on :8080
peapress new <name> [collection] # scaffold a new content file
peapress --help