Skip to content

Commit 967c7fb

Browse files
committed
Add Linux command list total page.
1 parent b610bdb commit 967c7fb

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

build/compile.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,19 @@ CreateDatajs('./.deploy/js/dt.js',function(dt_path,arr){
9797
n:'搜索',
9898
d:'最专业的Linux命令大全,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。'
9999
});
100+
101+
ReadTmpToHTML('/template/hot.ejs','/.deploy/hot.html',null,{
102+
p:'/hot.html',
103+
n:'搜索',
104+
d:'最专业的Linux命令大全,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。',
105+
arr:arr
106+
});
100107
// 文章批量生成
101108
arr.forEach(function(itm,idx){
102109
var ejstpm = path.join('/template/',itm.p);
103110
var md_path = path.join('/command',itm.p);
104111
var dep = path.join('/.deploy/c',itm.p);
105-
ReadTmpToHTML('/template/details.ejs', dep+'.html' ,md_path+'.md', itm)
112+
ReadTmpToHTML('/template/details.ejs', dep+'.html' ,md_path+'.md', itm ,arr)
106113
});
107114

108115
console.log(success(" → "),arr.length)
@@ -164,8 +171,9 @@ function CreateJS(from_path,to_path){
164171
* @param {[type]} to_path [生成到指定的位置]
165172
* @param {[type]} md_path [Markdown的路径] // 给md地址就生产详情页面
166173
* @param {[type]} des_json [页面信息 json 格式]
174+
* @param {[type]} arr []
167175
*/
168-
function ReadTmpToHTML(from_path,to_path,md_path,des_json){
176+
function ReadTmpToHTML(from_path,to_path,md_path,des_json, total_pages){
169177
var tmp_path = path.join(path.dirname(__dirname),from_path);
170178
if(!exists(tmp_path)) return console.log("\n → error: 模板文件 "+tmp_path+" 不存在")
171179
var tmp_str = fs.readFileSync(tmp_path);

template/header.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
88
<meta name="description" content="<%=describe.n?describe.n+':':''%><%=describe.d?describe.d+' - ':''%>最专业的Linux命令大全,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。">
99
<meta name="keywords" content="Linux,Command,命令大全,Linux命令手册<%=describe.n?','+describe.n:''%>">
10-
<title><%=describe.n?describe.n+' - ':''%>Linux Command</title>
10+
<title><%=describe.n?describe.n+' - ':''%>Linux 命令<%=describe.n?describe.n+' - ':''%></title>
1111
<link rel="shortcut icon" href="<%=relative_path%>img/favicon.ico">
1212
<link rel="stylesheet" type="text/css" href="<%=relative_path%>css/index.css?v=<%=new Date().getTime()%>">
1313
</head>

template/hot.ejs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
<%- include('header',{src:""}); %>
3+
<%- include('search',{type: "list"}); %>
4+
5+
<div class="hotlist">
6+
<ul>
7+
<%describe.arr.forEach(function(page,item){%>
8+
<li><a href="c<%=page.p%>.html"><%=page.n%> - <%=page.d%></a></li>
9+
<%});%>
10+
</ul>
11+
</div>
12+
13+
<%- include('footer'); %>

template/search.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
</div>
1818
<div class="footer">
1919
收藏本站请使用Ctrl+D或者Command+d<br>
20-
共搜集到 <span id="commands_info"><%=describe.command_length?describe.command_length:''%></span> 个Linux命令 <a target="_blank" href="https://github.com/jaywcjlove/linux-command/new/master/command">添加命令</a>
20+
共搜集到 <span id="commands_info"><%=describe.command_length?describe.command_length:''%></span> 个Linux命令 <a target="_blank" href="https://github.com/jaywcjlove/linux-command/new/master/command">添加命令</a> | <a href="hot.html">命令列表</a>
2121
</div>
2222
</div>

template/styl/index.styl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ a.github-corner {
2626
height 70px
2727
}
2828
}
29+
a{
30+
transition: all .2s ease-in
31+
}
2932

3033
@keyframes octocat-wave{
3134
0%,100%{-webkit-transform:rotate(0);transform:rotate(0)}
@@ -241,6 +244,27 @@ a.github-corner {
241244

242245
}
243246

247+
.hotlist{
248+
padding 79px 27px
249+
a{
250+
font-size 16px
251+
strong{
252+
font-weight bold
253+
}
254+
&:hover{
255+
}
256+
}
257+
li{
258+
padding 5px 0 5px 0
259+
list-style-type none
260+
p{
261+
padding-top 5px
262+
color #4F4F4F
263+
}
264+
}
265+
266+
}
267+
244268

245269
@media mq-mobile{
246270
.header{

0 commit comments

Comments
 (0)