How to use the dustjs-linkedin.makeBase function in dustjs-linkedin

To help you get started, we’ve selected a few dustjs-linkedin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Postleaf / postleaf / source / modules / dust_engine.js View on Github external
return function(file, options, callback) {
      if(!file) {
        return callback(new Error('No template specified.'));
      }

      // Create the base context
      let baseContext = Dust.makeBase(
        // Context globals
        {
          Template: {
            // Always the filename without extension
            name: Path.basename(this.name, '.dust')
          }
        },
        // Context options
        {
          viewFolders: this.root,
          template: this.name,
          extension: this.ext || Path.extname(file),
          locals: options
        }
      ).push(options);
github davglass / express-dust / lib / dust.js View on Github external
var fs     = require('fs'),
    fsPath = require('path'),
    http   = require('http'),

    dust = require('dustjs-linkedin'),

    baseContext = dust.makeBase({});

var mix = function(s, d) {
    for (var i in s) {
        d[i] = s[i]
    }
    return d;
}

module.exports = {
    filters : dust.filters
  , makeBase: function(obj) {
        baseContext = dust.makeBase(mix(baseContext.global, obj));
        return baseContext;
    }
}
github darkspotinthecorner / DarkTip / src / darktip.js View on Github external
'to': 'window',
							'attachment': 'together',
							'pin': true
						}
					]
				}
			},
			'hoverintent': {
				'timeout': 300,
				'interval': 75,
				'sensitivity': 7
			}
		}
	};

	settingsContext = dust.makeBase().push(settings);

	DarkTip.setting = function(key, data) {
		var tplNames = [];
		if (typeof data === 'undefined') {
			return settingsContext.get(key);
		}
		tplNames = key.match(/^module\.template\.([^\.].*)$/);
		if (tplNames && tplNames.length)
		{
			data = dust.loadSource(dust.compile(data, tplNames[1]));
		}
		settingsContext.set(key, data);
		return this;
	};

	DarkTip.css = (function() {
github davglass / express-dust / lib / dust.js View on Github external
, makeBase: function(obj) {
        baseContext = dust.makeBase(mix(baseContext.global, obj));
        return baseContext;
    }
}