Sha256: 0b3ade3831fbaa14c6cfef16f5d80f15add07abfea91015d646c346e8f3926f7

Contents?: true

Size: 1.2 KB

Versions: 38

Compression:

Stored size: 1.2 KB

Contents

/*
 *  Copyright 2011 Twitter, Inc.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

var Hogan = require(__dirname + '/../lib/hogan.js');
var fs = require('fs');
var path = require('path');

// Substitute variables in the homepage with values from package.json
var homeTemplatePath = __dirname + '/../build/gh-pages/index.html.mustache';
var contextPath = __dirname + '/../dist/nodejs/package.json';

var homepage = fs.readFileSync(homeTemplatePath).toString();
var context = JSON.parse(fs.readFileSync(contextPath).toString());

var template = Hogan.compile(homepage);

fs.writeFileSync(path.dirname(homeTemplatePath) + '/index.html',
                 template.render(context));

fs.unlinkSync(homeTemplatePath);

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
cmstyle-0.0.13 lib/assets/javascripts/web_templates.js
cmstyle-0.0.12 lib/assets/javascripts/web_templates.js
sass-twitter-bootstrap-0.1.0 docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.8 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.9 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.8 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.7 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.6 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.5 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.4 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.3 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.2 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7.1 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.7 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.6 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.5 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.4 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.3 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.2 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js
bootstrapped-rails-2.0.1 vendor/assets/twitter/docs/build/node_modules/hogan.js/tools/web_templates.js