From ef71ec77fe22f9460f193a752825aebaf00ff7cf Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Fri, 21 Sep 2018 13:36:30 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9E=84=E5=BB=BA=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/tools/translator/assets/aio-shell-index.html | 8 ++++++++ aio/tools/translator/bin/ssr.ts | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 aio/tools/translator/assets/aio-shell-index.html diff --git a/aio/tools/translator/assets/aio-shell-index.html b/aio/tools/translator/assets/aio-shell-index.html new file mode 100644 index 0000000000..4042812112 --- /dev/null +++ b/aio/tools/translator/assets/aio-shell-index.html @@ -0,0 +1,8 @@ + diff --git a/aio/tools/translator/bin/ssr.ts b/aio/tools/translator/bin/ssr.ts index eeaf8a4e84..73032c1ad3 100644 --- a/aio/tools/translator/bin/ssr.ts +++ b/aio/tools/translator/bin/ssr.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as mkdirp from 'mkdirp'; import * as path from 'path'; -function buildSsrPages(): void { +function buildInnerPages(): void { const navigation = fs.readFileSync('./content/navigation.json', 'utf-8'); const indexTemplate = fs.readFileSync('./dist/index.html', 'utf-8'); const aioShellTemplate = fs.readFileSync(__dirname + '/../assets/aio-shell-template.html'); @@ -22,4 +22,12 @@ function buildSsrPages(): void { }); } -buildSsrPages(); +function buildIndexPage(): void { + const indexTemplate = fs.readFileSync('./dist/index.html', 'utf-8'); + const aioShellIndex = fs.readFileSync(__dirname + '/../assets/aio-shell-index.html'); + const content = indexTemplate.replace('', `${aioShellIndex}`); + fs.writeFileSync(`./dist/index.html`, content, 'utf-8'); +} + +buildInnerPages(); +buildIndexPage();