Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metonym/nouveau

Old school Static Site Generator using Svelte and PostHTML
https://github.com/metonym/nouveau

posthtml static-site-generator svelte

Last synced: 11 days ago
JSON representation

Old school Static Site Generator using Svelte and PostHTML

Awesome Lists containing this project

README

        

# nouveau

[![NPM][npm]][npm-url]
[![Build][build]][build-badge]

> Old school Static Site Generator using Svelte and PostHTML.

`nouveau` enhances your static web pages with JavaScript by using Svelte. No JavaScript is generated if the Svelte markup is purely static (i.e. presentational).

See the example project:

- **[example/src](example/src)**: Source files
- **[example/public](example/public)**: Generated files with compiled Svelte code

## Quick start

Get started with a basic template:

```bash
npx degit metonym/nouveau#template my-app
cd my-app
yarn install
```

## Install

```bash
yarn add -D nouveau
```

### 1) Folder structure

Create folders and `index.html` files in the `src` folder:

```bash
mkdir src
touch src/index.html
```

Your folder structure should look similar to this:

```bash
├── src
│ ├── index.html
│ └── [folder]/index.html
├── package.json
└── .gitignore
```

### 2) Content

Add the following to your `src/index.html`:

```html







let count = 0;


Increment the count: {count}


```

### 3) Scripts

Add the following scripts to your `package.json`:

```json
// package.json
{
"scripts": {
"start": "nouveau --dev",
"build": "nouveau"
}
}
```

Run the following command in development:

```bash
yarn start
```

For production, use:

```bash
yarn build
```

## Customization

Customize the `entry` and `outDir` fields in your `package.json`:

```diff
"nouveau": {
"entry": "src",
- "outDir": "public"
+ "outDir": "dist"
}
```

## License

[MIT](LICENSE)

[npm]: https://img.shields.io/npm/v/nouveau.svg?color=blue
[npm-url]: https://npmjs.com/package/nouveau
[build]: https://travis-ci.com/metonym/nouveau.svg?branch=master
[build-badge]: https://travis-ci.com/metonym/nouveau