routo
filesystem-routing builder for static site generation
Overview
How it works
- Generates files using
export default
in files named[name].[filetype].js
- Export a String for text-based files (.html, .css, etc)
- Export a Buffer for images and other raw data formats (.png, .gif, .pdf)
- Export a Promise for asynchronous generation (useful for fetching remote data)
- Copies normal, static files from source to destination automatically
Features
-
Write modern, ES6 Syntax in Node thanks to
esm
-
Watches files and their dependencies for changes thanks to
jeye
-
Install size is minimal compared to other builders
-
[Advanced] Add filetype-specific transformers for compilation, minification, and compression
-
[Advanced] Add aggregate builders for bundling components, styles, or any other multi-file bundle
Usage
Cloneable Template
Custom Configuration
Install routo
& serve
npm i routo && npm i -D serve
Setup dev
and build
scripts
"scripts": {
"dev": "routo pages,assets public -w & serve public",
"build": "routo pages,assets public"
}
Deployment
API
CLI
Config File
Advanced
Builders
Transforms
Examples
- Static HTML page
- CSS Generator
- Folder of blog pages
- Spritesheet generator
- Remote data fetching
Details
Roadmap
- More config options for builds/transforms
- Better error handling and messages
License
MIT © Marshall Brandt