-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmpl.js
92 lines (88 loc) · 2.13 KB
/
tmpl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
module.exports = function (results, treeData, title = '') {
title = title ? ('The Index of \"' + title + '\"') : 'Index';
let str = `<!DOCTYPE html>
<html>
<head>
<title>${title}</title>
<style type="text/css" media="screen">
body {
color: #333;
font-size: 12px;
font-family:"Microsoft YaHei",Arial,sans-serif;
padding: 0;
margin: 0
}
h1 {
border-bottom: 1px solid #c0c0c0;
margin-bottom: 10px;
padding-bottom: 10px;
white-space: nowrap;
text-align: center;
}
a {
color: #707070;
text-decoration: none
}
a:hover {
text-decoration: underline;
color: #2d64b3
}
ul,li {
list-style: none;
padding: 0;
margin: 0;
white-space: pre;
}
.index-list::after {
display: block;
visibility: hidden;
height: 0;
clear: both;
content: " "
}
.index-list li {
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #e5e4e9;
}
h3 {
color: #1a79ff;
font-size: 18px;
margin: 0;
}
.text-center{
text-align:center;
}
.wrap {
width: 1002px;
margin: 100px auto 0;
}
.footer {
display: block;
float: left;
width: 100%;
padding-top: 30px
}
.footer p {
text-align: center
}
</style>
</head>
<body>
<h1 id="header">${title}</h1>
<div class="wrap">
<ul class="index-list">
`
results.forEach(item => {
str += `<li><h3><a href="${item}" title="">${item}</a></h3></li>`
})
str += `
</ul>
<div class="footer">
<p>Generated by <a href="https://github.com/icai/ndex">ndex</a></p>
</div>
</div>
</body>
</html>`
return str;
}