0.1.4 • Published 6 years ago
nouveau v0.1.4
nouveau
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: Source files
- example/public: Generated files with compiled Svelte code
Quick start
Get started with a basic template:
npx degit metonym/nouveau#template my-app
cd my-app
yarn installInstall
yarn add -D nouveau1) Folder structure
Create folders and index.html files in the src folder:
mkdir src
touch src/index.htmlYour folder structure should look similar to this:
├── src
│ ├── index.html
│ └── [folder]/index.html
├── package.json
└── .gitignore2) Content
Add the following to your src/index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<svelte>
<script>
let count = 0;
</script>
<button on:click="{() => { count += 1; }}">
Increment the count: {count}
</button>
</svelte>
</body>
</html>3) Scripts
Add the following scripts to your package.json:
// package.json
{
"scripts": {
"start": "nouveau --dev",
"build": "nouveau"
}
}Run the following command in development:
yarn startFor production, use:
yarn buildCustomization
Customize the entry and outDir fields in your package.json:
"nouveau": {
"entry": "src",
- "outDir": "public"
+ "outDir": "dist"
}