From e0a4d1bb1339e80775aa37efaf8cac314278f8e9 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 19 Oct 2020 21:55:02 -0500 Subject: Add navigation template and logout --- src/templates.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/templates.js') 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 } -- cgit v1.2.3