Skip to content

Instantly share code, notes, and snippets.

@grejdi
Last active October 10, 2015 16:38

Revisions

  1. grejdi renamed this gist Feb 11, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion gistfile1.js → compile.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    // load 'hogan' library
    load('js/lib/hogan/web/builds/2.0.0/hogan-2.0.0.js');

  2. grejdi created this gist Sep 14, 2012.
    14 changes: 14 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@

    // load 'hogan' library
    load('js/lib/hogan/web/builds/2.0.0/hogan-2.0.0.js');

    // initialize templates object
    print('var templates = {');

    // read mustache template content from file path
    template = readFile('templates/index.mustache');
    // print compiled function from Hogan
    print('"index" : new Hogan.Template(' + Hogan.compile(template, {asString : true}) + ')');

    // close object
    print('};');