I'm currently working on a project using Express Handlebars. I have a template called foo.hbs
that contains some JavaScript code which I need to insert below the script tags in the layout.hbs
file:
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
{{{body}}}
<script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../bower_components/bootstrap/dist/js/bootstrap.js"></script>
<!-- INSERT custom code here -->
</body>
</html>
If the content of foo.hbs
was as follows:
<p>Hello World</p>
<!-- Want to insert this below script tags in layout.hbs -->
<script>
// Some script that requires jQuery
</script>
Do you have any suggestions on how to achieve this?
Thanks.