How to use the jade.compileFile function in jade

To help you get started, we’ve selected a few jade 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 youngsterxyf / redis-sentinel-ui / utils / template.js View on Github external
function _render(relativePath, data) {
    // templateCache = {};
    let filePath = path.join(global.RootDir, relativePath);

    if (!(filePath in templateCache)) {
        templateCache[filePath] = jade.compileFile(filePath, {
            pretty: true
        });
    }

    return templateCache[filePath](data);
}
github youngsterxyf / redis-sentinel-ui / template.js View on Github external
function render(relativePath, data) {
    var filePath = path.join(global.RootDir, relativePath);
    if (!templateCache.hasOwnProperty(filePath)) {
        templateCache[filePath] = jade.compileFile(filePath, {pretty: true});
    }

    return templateCache[filePath](data);
}
github stormpath / express-stormpath / lib / helpers / render.js View on Github external
function renderJade(filepath, locals) {
  var env = process.env.NODE_ENV;

  if (env === 'production') {
    if (!viewCache[filepath]) {
      viewCache[filepath] = jade.compileFile(filepath);
    }

    return viewCache[filepath](locals);
  }

  return jade.renderFile(filepath, locals);
}
github stormpath / express-stormpath / lib / helpers.js View on Github external
function renderJade(filepath,locals){
  var env = process.env.NODE_ENV;
  if( env ==='production' ){
    if(!viewCache[filepath]){
      viewCache[filepath] = jade.compileFile(filepath);
    }
    return viewCache[filepath](locals);
  }else{
    return jade.renderFile(filepath,locals);
  }
}
github ecomfe / echarts-examples / build.js View on Github external
function doCompile(srcRelativePath, lang) {
        let srcAbsolutePath = path.resolve(projectDir, srcRelativePath);
        let compiledFunction = jade.compileFile(srcAbsolutePath);
        return compiledFunction({
            buildVersion: config.buildVersion,
            lang: lang,
            host: config.host,
            blogPath: config.blogPath,
            mainSitePath: config.mainSitePath
        });
    }

jade

A clean, whitespace-sensitive template language for writing HTML

MIT
Latest version published 9 years ago

Package Health Score

58 / 100
Full package analysis