-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (35 loc) · 1.07 KB
/
index.html
File metadata and controls
41 lines (35 loc) · 1.07 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Mindmap Wiki</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div style="width: 600px; margin: 0 auto">
<h1>Mindmap Wiki</h1>
<ol class="gradient-list" id="list"></ol>
<script>
let data = ["./html/sample.md.html",
];
let list = document.getElementById("list");
data.forEach((item) => {
let li = document.createElement("li");
let link = document.createElement("a");
link.setAttribute("href", `${item}`);
link.setAttribute("target", "_blank");
// ./dist/sub/hoge.md.html -> hoge
let title = item.split("/").slice(-1)[0].split(".")[0];
if (title.includes("_")) {
title = title.charAt(0).toUpperCase() + title.slice(1);
link.textContent = title.split("_").join(" ");
} else {
link.textContent = title;
}
li.appendChild(link);
list.appendChild(li);
});
</script>
</div>
</body>
</html>