Skip to content

Instantly share code, notes, and snippets.

@bmatcuk
Created April 19, 2016 19:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmatcuk/5fddb13bcf47d5616a5ba2b60caaf53b to your computer and use it in GitHub Desktop.
Save bmatcuk/5fddb13bcf47d5616a5ba2b60caaf53b to your computer and use it in GitHub Desktop.
Sample html-brunch-static project using only handlebars

Sample html-brunch-static Project

This is a sample project that only uses the built-in handlebars processor. html-brunch-static supports many other options.

Running Locally

Copy these files locally into the following directory hierarchy:

test
├── app
│   ├── index.static.hbs
│   └── layouts
│       └── main.static.hbs
├── brunch-config.coffee
└── package.json

Then run:

npm install
brunch build

Output should be a single file called index.html in a directory called public.

exports.config =
files: {}
plugins:
static:
processors: [
require('html-brunch-static') {
handlebars:
enableProcessor: true
}
]
---
title: World
_options:
layout: app/layouts/main.static.hbs
---
<p>Hello, {{title}}!</p>
<!doctype html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
<h1>Test</h1>
{{content}}
</body>
</html>
{
"name": "test",
"version": "1.0.0",
"description": "",
"private": true,
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Bob Matcuk (http://squeg.net)",
"license": "MIT",
"devDependencies": {
"brunch": "^2.6.2",
"brunch-static": "^1.1.1",
"html-brunch-static": "^1.2.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment