Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

includeHtml.js 443B

123456789101112131415161718192021222324
  1. var fs = require("fs");
  2. var minify = require("./minify.js");
  3. var preprocess = require("./preprocess.js");
  4. var cache = {};
  5. module.exports = function load(path, conf) {
  6. var html = fs.readFileSync(path, "utf8");
  7. var env = {
  8. conf: conf,
  9. template: function(key) {
  10. var str = load("templates/"+key+".html", conf);
  11. return str;
  12. }
  13. }
  14. html = preprocess(html, env);
  15. if (conf.minify)
  16. return minify.html(html);
  17. else
  18. return html;
  19. }