Static site generator bild with KISS principle.
npm install kiss-my-asset
Create kiss-my-asset.js
in root of your project.
const renderPage = (path) => {
return `Welcom on page ${path}`
}
const genPaths = () => ['/c.html', '/d.html']
exports.outputDir = '_site'
exports.routes = [
{ path: '/index.html', use: renderPage },
{ path: ['/a.html', '/b.html'], use: renderPage },
{ path: genPaths, use: renderPage }
]
Run in root of your project
npx kiss-my-asset generate
Run in root of your project
npx kiss-my-asset server
Web page is available under http://localhost:8080/