wunphile
Version:
Simple, imperative JavaScript-based static site generator
21 lines (14 loc) • 617 B
JavaScript
import { Wunphile } from '../index.mjs'
import { NotFoundPage } from './src/component/page/NotFoundPage.mjs'
import { IndexPage } from './src/component/page/IndexPage.mjs'
import { AboutPage } from './src/component/page/AboutPage.mjs'
const ssg = new Wunphile(import.meta.url)
// Register pages.
ssg.page('/index.html', IndexPage)
ssg.page('/about/index.html', AboutPage)
// Register the "not found" page.
// Defaults to "/404.html" unless overridden.
ssg.notFoundPage(NotFoundPage)
// Mount static files from the local "static" directory to the root of the site.
ssg.staticDir('/', './static')
await ssg.cli()