-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
- Node.js 18 or later
-
Create your repository — Click "Use this template" on the PutOut repo, or fork it.
-
Clone it locally:
git clone https://github.com/<username>/<repository>.git cd <repository>
-
Install dependencies:
npm install
Start the dev server with live reload:
npm run startThis opens a local server at http://localhost:8080/. Whenever you save a file — a chapter, a template, or a configuration change — the site automatically rebuilds and your browser refreshes to show the latest version.
Generate the full static site (HTML + CSS + PDF/EPUB):
npm run buildOutput goes to dist/.
When you run npm run build, three things happen in sequence:
- Site pages are generated — Your Markdown chapters and templates are turned into HTML pages
- Styles are built — The CSS is compiled and minified for fast loading
-
PDF and EPUB are created — If enabled, your chapters are combined into downloadable book files in the
dist/folder
| Command | What it does |
|---|---|
npm run start |
Dev server with live reload |
npm run build |
Full production build (site + styles + PDF/EPUB) |
npm run build:eleventy |
Build only the site pages |
npm run build:tailwind |
Build only the CSS (minified) |
npm run build:formats |
Generate PDF and EPUB files only |
src/
├── _data/
│ ├── site.js # Central configuration
│ ├── accentColors.js # 8 color palettes
│ └── fonts.js # Google Fonts URL builder
├── _includes/
│ ├── base.njk # Root HTML layout
│ ├── homepage.njk # Homepage layout
│ ├── chapter.njk # Chapter page layout
│ ├── chapterCard.njk # Chapter card component
│ └── tracking.njk # Analytics snippet (empty by default)
├── chapters/
│ ├── 01-chapter-one.md
│ ├── 02-chapter-two.md
│ └── _chapter-template.md # Starter template (excluded from build)
├── scripts/
│ └── navigation.js # Client-side interactions
├── styles/
│ └── tailwind.css # Tailwind entry point
├── index.njk # Homepage
├── 404.njk # Custom error page
├── robots.njk # robots.txt template
└── sitemap.njk # XML sitemap template
scripts/
└── generate-formats.js # PDF/EPUB generation script
.eleventy.js # Eleventy configuration
tailwind.config.js # Tailwind configuration
netlify.toml # Netlify deployment config
If you see an error about port 8080 being busy, another process is using it. Either stop that process or close the other terminal running a dev server, then try npm run start again.
If you change templates and the styling looks wrong or unchanged, stop the dev server (Ctrl+C) and restart it with npm run start. The Tailwind CSS rebuild sometimes needs a fresh start to pick up new class names.
After changing fonts in site.js, restart the dev server. The Google Fonts URL is generated at build time, so a restart is needed for new fonts to take effect.
site.js is read when the build starts. After editing it, restart the dev server (Ctrl+C, then npm run start) for changes to take effect.
- Configuration — Customize your site title, author, theme, and fonts
- Chapters — Add your own chapters
- Theme and Colors — Pick an accent color for your site
- Customization — Change fonts, add analytics, replace the favicon
- Deployment — Publish your site to the web