Backbone Multipage Boilerplate
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
js
.gitignore
README.md
index.html

README.md

Backbone Multipage Boilerplate

Why another backbone boilerplate?

No reason really. I just wanted to share my setup.

What it uses

Requirements

  • Bower - We need this to manage our libraries
  • Node - We need this to concat and minify our build using r.js

Setup

Clone this repository

git clone https://github.com/mattdrose/backbone-multipage-boilerplate.git

Go into the js/ directory

cd backbone-multipage-boilerplate/js

Install the dependencies

bower install

Create your build

./build.sh

Load the goodies

Include this script tag in your page.

<script id="js-main" data-page="js/dist/home" src="js/dist/main.js"></script>
  • src refers to your global javascript.
  • data-page refers to your page specific javascript.

Adding a new page

Add this to the modules in js/build/build.js

{
	name: 'name-of-page',
	exclude: ['main']
}

Create a corresponding javascript file in the js/src/ directory. In this case, js/src/name-of-page.js