0.1.1 • Published 5 years ago
brap-ssg v0.1.1
Brap Static Site Generator
Jam out a static site
Design Goals
- Write markdown and YAML to HTML
- Use template functions (not templating languages)
- Support clean URLs
Install
npm install brap-ssg
Usage
brap --s 'src/md' --d 'build' --t 'your-template.js'
API
--s, --src Directory to read from (defaults to src/md)
--d, --dest Directory to write to (defaults to build)
--t, --template Template to apply
--c, --clean-urls Option to use clean URLs (defaults to true)
Example Markdown File
---
title: 'Whatever'
---
Lorem ipsum.
Example Template Function
// your-template.js
const yourTemplate = (html, { title } = metadata) => {
return `<!DOCTYPE html>
<title>${title}</title>
<main>
<h1>${title}</h1>
${html}
</main>
`
}
module.exports = yourTemplate
Weirdness with clean URLs (fix this pattern)
Bad
- src/about-me/about-me.md => build/about-me/about-me/index.html
- src/about-me/index.md => build/about-me/index/index.html
Good
- src/about-me/about-me.md => build/about-me/index.html
- src/about-me/index.md => build/about-me/index.html