Files
@ 1759a07630a8
Branch filter:
Location: symposion_app/gulp/tasks/handlebars.js - annotation
1759a07630a8
803 B
application/javascript
A few mods to be able to use the runserver site for debugging. We'll back these out once the real
(via apache) site is up and running.
(via apache) site is up and running.
dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 dd8f0ba9c517 | /**
* Dependencies
*/
const fs = require('fs');
const gulp = require('gulp');
const handlebars = require('gulp-compile-handlebars');
const path = require('path');
const rename = require('gulp-rename');
/**
* Module body / Expose
*/
module.exports = (manifestPath, scriptSourceTemplate, staticRoot) => {
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
const handlebarOpts = {
helpers: {
assetPath: (path, context) => {
return [staticRoot, context.data.root[path]].join('/');
}
}
};
const outputFile = path.basename(scriptSourceTemplate).replace('.hbs', '.html');
return gulp.src(scriptSourceTemplate)
.pipe(handlebars(manifest, handlebarOpts))
.pipe(rename(outputFile));
};
|