GithubHelp home page GithubHelp logo

neilthawani / panhandle Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 8.62 MB

Compile Handlebars Templates in a Github Pages Static Site

JavaScript 3.92% HTML 1.02% CSS 95.06%
github handlebars pages templates

panhandle's People

Contributors

neilthawani avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

saurabharch

panhandle's Issues

Missing build.js file

// 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);

Add description and author fields as prompt.

In lib/config.js, the user's package.json file is set up and installed in setupPackageJson, according to the settings object.

This could be enhanced slightly by adding a prompt so that the user can append a description and author field to the settings object based on their own user input.

Fix npm install in lib/config.js

In lib/config.js, the user's package.json file is set up and installed in setupPackageJson.

The childProcess package is then used to run npm install ${settings} in the user's current working directory.

I'm not sure this is the correct syntax, but I'm not sure why it's not working properly, nor in the desired order.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.