Skip to content

Instantly share code, notes, and snippets.

@dpowell
Last active December 16, 2015 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpowell/5395640 to your computer and use it in GitHub Desktop.
Save dpowell/5395640 to your computer and use it in GitHub Desktop.
<p>Hello, world!</p>
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jst: {
compile: {
files: {
'dist/templates.js': ["app/templates/**/*.html"]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.registerTask('default', ['jst']);
};
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div class="container">
<div id="content"></div>
</div>
<script src="../dist/jquery-1.9.1.js"></script>
<script src="../dist/underscore.js"></script>
<script src="../dist/templates.js"></script>
<script>
$('#content').html(JST['app/templates/greeting.html']());
</script>
</body>
</html>
{
"name": "credo-web",
"version": "0.0.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jst": "~0.5.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment