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();