Skip to content

Instantly share code, notes, and snippets.

@subkitio
Last active November 25, 2015 08:10
Show Gist options
  • Save subkitio/c4152f532227ea3a9134 to your computer and use it in GitHub Desktop.
Save subkitio/c4152f532227ea3a9134 to your computer and use it in GitHub Desktop.
Example HTML/EJS Apps

Content One

This is an example content section.

Content Two

This is an example content section.

<ul class="nav nav-pills nav-stacked">
<li><a href="#html-ejs-apps-content-one"><i class="fa fa-caret-right"></i> Item 1</a></li>
<li><a href="#html-ejs-apps-content-two"><i class="fa fa-caret-right"></i> Item 2</a></li>
</ul>
body {
margin: 0;
padding 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML/EJS App</title>
<!-- Public CDN resources -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/g/bootstrap@3.3.5(css/bootstrap.min.css)">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css">
<!-- Include your custom CSS resource -->
<link rel="stylesheet" href="html-ejs-apps.css">
<!-- Public CDN resources -->
<script defer src="https://cdn.jsdelivr.net/g/jquery@3.0.0-alpha1,bootstrap@3.3.5,modernizr@2.8.3"></script>
<!-- Include your custom JavaScript resource -->
<script defer src="html-ejs-apps.js"></script>
</head>
<body>
<div class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="https://www.subkit.io/doc/#examples-html-templates">HTML/EJS App</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-3">
<nav></nav>
</div>
<div class="col-xs-12 col-sm-9">
<content></content>
</div>
</div>
</div>
</body>
</html>
$(function(){
$('nav').load('html-ejs-apps-nav');
$(window).on('hashchange', function() {
$('content').load(window.location.hash.replace('#',''));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment