docs: 构建首页
This commit is contained in:
parent
6dee3bf0a7
commit
ef71ec77fe
8
aio/tools/translator/assets/aio-shell-index.html
Normal file
8
aio/tools/translator/assets/aio-shell-index.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<ul role="navigation"><!---->
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="/features" title="特性">特性</a></li>
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="/docs" title="文档">文档</a></li>
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="/resources" title="资源">资源</a></li>
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="/events" title="会议">会议</a></li>
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="https://blog.angular.io/" title="博客">博客</a></li>
|
||||||
|
<li class="ng-star-inserted"><a class="nav-link" href="/translations/cn/home" title="关于中文版">关于中文版</a></li>
|
||||||
|
</ul>
|
@ -2,7 +2,7 @@ import * as fs from 'fs';
|
|||||||
import * as mkdirp from 'mkdirp';
|
import * as mkdirp from 'mkdirp';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
function buildSsrPages(): void {
|
function buildInnerPages(): void {
|
||||||
const navigation = fs.readFileSync('./content/navigation.json', 'utf-8');
|
const navigation = fs.readFileSync('./content/navigation.json', 'utf-8');
|
||||||
const indexTemplate = fs.readFileSync('./dist/index.html', 'utf-8');
|
const indexTemplate = fs.readFileSync('./dist/index.html', 'utf-8');
|
||||||
const aioShellTemplate = fs.readFileSync(__dirname + '/../assets/aio-shell-template.html');
|
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('<aio-shell></aio-shell>', `<aio-shell>${aioShellIndex}</aio-shell>`);
|
||||||
|
fs.writeFileSync(`./dist/index.html`, content, 'utf-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
buildInnerPages();
|
||||||
|
buildIndexPage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user