diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-10-19 21:55:02 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-10-19 21:55:02 -0500 |
commit | e0a4d1bb1339e80775aa37efaf8cac314278f8e9 (patch) | |
tree | 91c09487df6793e4faaed4c0a883cba2ae199d20 /src/templates.js | |
parent | ad24db7fe9fca72c38caaa40d2ada8cbeb04994d (diff) |
Add navigation template and logout
Diffstat (limited to 'src/templates.js')
-rw-r--r-- | src/templates.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/templates.js b/src/templates.js index 28435f8..a9e3305 100644 --- a/src/templates.js +++ b/src/templates.js @@ -7,7 +7,13 @@ function loadTemplate(templates, name, filepath){ templates[name] = handlebars.compile(templateContent); } +function loadPartial(name, filepath){ + handlebars.registerPartial(name, fs.readFileSync(filepath).toString()); +} + function setUpTemplates(){ + loadPartial("navigation", path.join(__dirname, "templates/navigation.html")) + let templates = {}; loadTemplate(templates, "about", path.join(__dirname, 'templates/about.html')) loadTemplate(templates, "login", path.join(__dirname, 'templates/login.html')) @@ -17,7 +23,6 @@ function setUpTemplates(){ loadTemplate(templates, "goals", path.join(__dirname, 'templates/goals.html')) loadTemplate(templates, "expected", path.join(__dirname, 'templates/expected.html')) loadTemplate(templates, "summary", path.join(__dirname, 'templates/summary.html')) - return templates } |