feat: Add contributors pages.
This commit is contained in:
parent
c3a24f2a31
commit
bc49f6f7e7
|
|
@ -12,6 +12,7 @@ const rootIndexJSPath = path.resolve(process.cwd(), 'template', 'js', 'index.js'
|
|||
const dataJsonPath = path.resolve(process.cwd(), 'dist', 'data.json');
|
||||
const dataJsonMinPath = path.resolve(process.cwd(), 'dist', 'data.min.json');
|
||||
const cssPath = path.resolve(deployDir, 'css', 'index.css');
|
||||
const contributorsPath = path.resolve(deployDir, 'CONTRIBUTORS.svg');
|
||||
|
||||
;(async () => {
|
||||
try {
|
||||
|
|
@ -71,6 +72,24 @@ const cssPath = path.resolve(deployDir, 'css', 'index.css');
|
|||
command_length: jsonData.data.length
|
||||
}
|
||||
);
|
||||
|
||||
let svgStr = '';
|
||||
if (FS.existsSync(contributorsPath)) {
|
||||
svgStr = (await FS.readFile(contributorsPath)).toString();
|
||||
}
|
||||
|
||||
await createTmpToHTML(
|
||||
path.resolve(process.cwd(), 'template', 'contributors.ejs'),
|
||||
path.resolve(deployDir, 'contributors.html'),
|
||||
{
|
||||
p: '/contributors.html',
|
||||
n: '搜索',
|
||||
d: '最专业的Linux命令大全,命令搜索引擎,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。',
|
||||
arr: jsonData.data,
|
||||
command_length: jsonData.data.length,
|
||||
contributors: svgStr,
|
||||
}
|
||||
);
|
||||
|
||||
await Promise.all(jsonData.data.map(async (item, idx) => {
|
||||
item.command_length = jsonData.data.length;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<%- include('partial/header'); %>
|
||||
<%- include('widget/search',{type: "list"}); %>
|
||||
<div class="contributors">
|
||||
<h1>Contributors</h1>
|
||||
<div><%=describe.contributors ? describe.contributors : '' %></div>
|
||||
</div>
|
||||
<%- include('widget/footer',{type: "list"}); %>
|
||||
<%- include('partial/footer'); %>
|
||||
|
|
@ -295,11 +295,18 @@ a {
|
|||
}
|
||||
}
|
||||
|
||||
.header_inner, .hotlist, .search_list {
|
||||
.header_inner, .hotlist, .search_list, .contributors {
|
||||
max-width 920px
|
||||
margin 0 auto
|
||||
}
|
||||
|
||||
.contributors {
|
||||
padding 79px 27px
|
||||
a {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
@media mq-mobile {
|
||||
.header{
|
||||
width inherit
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
<br /> 共搜集到
|
||||
<span id="commands_info">
|
||||
<%=describe.command_length?describe.command_length:''%>
|
||||
</span> 个Linux命令
|
||||
</span> 个Linux命令,超过 <a href="<%=relative_path%>contributors.html">50+</a> 的贡献者
|
||||
</div>
|
||||
Loading…
Reference in New Issue