add script_tags helper
This commit is contained in:
10
src/app.js
10
src/app.js
@@ -43,6 +43,16 @@ hbs.registerHelper('section', (name, options) => {
|
||||
this._sections[name] = options.fn(this);
|
||||
return null;
|
||||
})
|
||||
hbs.registerHelper('script_tags', (scripts, options) => {
|
||||
if(!scripts) {
|
||||
return null;
|
||||
}
|
||||
var result = [];
|
||||
scripts.forEach((script)=>{
|
||||
result.push(`<script src="${script}"></script>`)
|
||||
})
|
||||
return result.join('\n');
|
||||
})
|
||||
hbs.registerHelper("embeddedSvgFromPath", require('./lib/utils').embeddedSvgFromPath)
|
||||
hbs.registerHelper(require("./controllers/event").helpers)
|
||||
hbs.registerHelper(require("./controllers/eventlineup").helpers)
|
||||
|
||||
@@ -31,4 +31,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{{{script_tags scripts}}}
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user