Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing build.js file #7

Open
neilthawani opened this issue Jun 18, 2018 · 0 comments
Open

Missing build.js file #7

neilthawani opened this issue Jun 18, 2018 · 0 comments

Comments

@neilthawani
Copy link
Owner

neilthawani commented Jun 18, 2018

// node build/build.js -d cwd -p "src/views/partials/**/*.hbs" -l "src/views/layouts/**/*.hbs" -t "src/views/templates/**/*.hbs" -v

let commander = require("commander");
let config = require("../config/config");
let handlebarsToHtml = require("../lib/handlebars-to-html");

commander
  .usage("-templates <pattern> -d <path>")
  .description("Write handlebars templates to a directory as static html.")
  .option("-d, --directory", "output directory")
  .option("-H, --helpers", "path to JavaScript file containing helpers")
  .option("-p, --partials [pattern]", "glob pattern to match partial files")
  .option("-l, --layouts [pattern]", "glob pattern to match layout files")
  .option("-t, --templates <pattern>", "glob pattern to match template files")
  .option("-v, --verbose", "output more information to console")
  .parse(process.argv);

if (commander.verbose) {
    process.env.debug = true;
}

if (commander.partials) {
    handlebarsToHtml.registerPartials(commander.partials, config.views.partialsFolder);
}

if (commander.layouts) {
    handlebarsToHtml.registerPartials(commander.layouts, config.views.layoutsFolder);
}

handlebarsToHtml.writeFiles(commander.templates, config.views.templatesFolder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant