diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-07-14 20:50:22 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-07-14 20:50:22 +0300 |
| commit | 58e0151fd1e9beb1c392163393f3669bfaa7eae1 (patch) | |
| tree | 37dbcb5f710c74a4593e4c8807c9f812c4c792da /build.js | |
| parent | e0fac3960f7cd246cb2ef70d58d9e6b532401f58 (diff) | |
Add contact me template, improve styling
Diffstat (limited to 'build.js')
| -rw-r--r-- | build.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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);
|
