Skip to content

Instantly share code, notes, and snippets.

@jdlich
Last active December 23, 2015 09:49
Show Gist options
  • Save jdlich/6616845 to your computer and use it in GitHub Desktop.
Save jdlich/6616845 to your computer and use it in GitHub Desktop.
<!doctype HTML>
<head>
<title></title>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/path.js/0.8.4/path.min.js"></script>
<script>
Path.map('#/').to(function() {
yield('home');
});
Path.map('#/:view').to(function() {
yield(this.params['view']);
});
Path.root('/');
Path.listen();
function yield(view) {
var content = 'views/' + view + '.html';
$("#yield").load(content, function() {
$(this).children().first().unwrap();
});
}
</script>
</head>
<body>
<header></header>
<div id="content">
<div id="yield"></div>
</div>
<footer></footer>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment