mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
init, just some testing
This commit is contained in:
23
src/templates.js
Normal file
23
src/templates.js
Normal file
@@ -0,0 +1,23 @@
|
||||
var fs = require('fs');
|
||||
|
||||
(function(Templates) {
|
||||
|
||||
global.templates = {};
|
||||
|
||||
function loadTemplates(templatesToLoad) {
|
||||
for (var t in templatesToLoad) {
|
||||
(function(template) {
|
||||
console.log(global.configuration.ROOT_DIRECTORY);
|
||||
fs.readFile(global.configuration.ROOT_DIRECTORY + '/public/templates/' + template + '.tpl', function(err, html) {
|
||||
global.templates[template] = html;
|
||||
console.log(html);
|
||||
});
|
||||
}(templatesToLoad[t]));
|
||||
}
|
||||
}
|
||||
|
||||
Templates.init = function() {
|
||||
loadTemplates(['header', 'footer', 'register', 'home']);
|
||||
}
|
||||
|
||||
}(exports));
|
||||
Reference in New Issue
Block a user