0.1.0 • Published 4 years ago

sausage v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Sausage

Static site generator

What?

It’s a static site generator. An SSG. Sausage. Get it? Ha ha. Moving on.

No really, what?

Sausage is a really simple tool with zero dependencies for building static sites with vanilla JavaScript.

The build process revolves around pages and templates.

Pages live in the content folder and are .js files that export things.

Templates live in the templates folder and are .js files that export a function. This function returns a string for a given page.

## How?

Here’s an absurdly simple hello world example.

Imagine this is your page content.

// pages/index.js
export const title = 'Hello, world!';
export const template = 'home';

And this is your template.

// templates/home.js
export default ({ title }) => `<p>${title}</p>`;

Run Sausage to build this to a build directory.

$ npx sausage
Building... done!
$ cat build/index.html
<p>Hello, world!</p>

Hurrah!