From 58e0151fd1e9beb1c392163393f3669bfaa7eae1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 14 Jul 2022 20:50:22 +0300 Subject: Add contact me template, improve styling --- build.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build.js') diff --git a/build.js b/build.js index b5a43b7..b81c740 100644 --- a/build.js +++ b/build.js @@ -18,10 +18,12 @@ function transpose(matrix) { } const GALLERY_DIR = "_gallery"; +const SITE_CONFIG_DIR = "_configuration"; const SRC_DIR = "src"; const DIST_DIR = "dist"; const HTML_TEMP_PATH = path.join(SRC_DIR, "index.html.mustache"); const HTML_OUT_PATH = path.join(DIST_DIR, "index.html"); +const CONTACT_INFO_PATH = path.join(SITE_CONFIG_DIR, "contact_info.json"); fs.rmSync(DIST_DIR, { recursive: true, force: true }); fs.cpSync(SRC_DIR, DIST_DIR, { recursive: true }); @@ -56,7 +58,14 @@ const galleryViews = galleryJsonList }; }); -const view = { galleries: galleryViews }; +const contactInfoJson = fs.readFileSync(CONTACT_INFO_PATH, "utf-8") +const contactInfoView = JSON.parse(contactInfoJson); + +const view = { + galleries: galleryViews, + contact_info_title: contactInfoView["title"], + contact_info_body: contactInfoView["body"], +}; const renderedHtml = M.render(htmlTemplate, view); fs.writeFileSync(HTML_OUT_PATH, renderedHtml); -- cgit v1.3