From 84fa6bd44952a04f251cf8e4502e92fdc451fbab Mon Sep 17 00:00:00 2001 From: Shailen Naidoo Date: Mon, 29 Jul 2019 13:19:39 +0200 Subject: [PATCH] Minor updates --- docs/index.html | 10 ++++++++++ docs/index.js | 19 +++++++++++++++++++ src/generator/helpers.ts | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 docs/index.html create mode 100644 docs/index.js diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..2709f98 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,10 @@ + + + + + Hydrogen + + +

Hydrogen: Static-site generator

+ + diff --git a/docs/index.js b/docs/index.js new file mode 100644 index 0000000..7d0e98b --- /dev/null +++ b/docs/index.js @@ -0,0 +1,19 @@ +const page = ({ title, text, dev }) => ` + + + + ${title} + + +

${text}

+ + +`; + +module.exports = { + title: 'Hydrogen', + page, + data: () => ({ + text: 'Hydrogen: Static-site generator', + }), +}; diff --git a/src/generator/helpers.ts b/src/generator/helpers.ts index 4bc88ce..d8c29e8 100644 --- a/src/generator/helpers.ts +++ b/src/generator/helpers.ts @@ -56,8 +56,10 @@ export const tempateGenerator = async (filename: string): Promise return false; } + console.time('build time'); const file = await import(`${CWD}/${filename}`); await fs.outputFile(filename.replace('.js', '.html'), await file.page({ title: file.title, ...file.data ? await file.data() : {} })); + console.timeEnd('build time'); }; // @ts-ignore