A lightweight static site generator built with Node.js, using EJS templates, glob, and promisified file handling to generate fast, SEO-friendly static websites.
- 🧩 EJS templating for reusable layouts
- 📁 File-based routing using
glob - ⚡ Fast static HTML generation
- 🔁 Async file operations using
util.promisify - 🏗️ Simple and minimal build system
- 📦 Easy to extend for blogs, portfolios, and landing pages
- Node.js
- EJS
- Glob
- fs-extra
- util.promisify
project-root/
│
├── src/
│ ├── pages/ # EJS page templates
│ ├── layouts/ # Layout files (header, footer, etc.)
│ ├── partials/ # Reusable components
│ └── assets/ # CSS, JS, images
│
├── public/ # Generated static site
├── build.js # Main build script
└── package.json
git clone https://github.com/your-username/static-site-generator.git
cd static-site-generator
npm installnode .scripts/build.js
npm run serveThis will:
- Read all EJS files using
glob - Render templates using EJS
- Output static HTML into the
dist/folder
globscans all page files inside/src/pagespromisifyconverts callback-based file functions into async/await- Each
.ejsfile is rendered into.html - Output is saved in
/publicas a fully static site
- Dynamic routing based on file structure
- Layout injection using EJS includes
- Clean async file handling with
fs-extra
- Personal portfolios
- Blogs
- Documentation sites
- Landing pages
Pull requests are welcome. For major changes, please open an issue first.
MIT License