Skip to content

Commit 095b3b4

Browse files
author
전진호
committed
feat: prettier index
1 parent e7ff575 commit 095b3b4

File tree

1 file changed

+60
-57
lines changed

1 file changed

+60
-57
lines changed

.scripts/index-page-builder.js

+60-57
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,79 @@ const baseDir = "./build";
88
let htmlContent = `
99
<!DOCTYPE html>
1010
<html lang="en">
11-
<head>
12-
<meta charset="UTF-8">
13-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
14-
<title>Project Index</title>
15-
<style>
16-
body {
17-
font-family: Arial, sans-serif;
18-
margin: 20px;
19-
background-color: #f9f9f9;
20-
color: #333;
21-
}
22-
h1 {
23-
text-align: center;
24-
color: #4CAF50;
25-
}
26-
ul {
27-
list-style-type: none;
28-
padding-left: 20px;
29-
}
30-
ul ul {
31-
padding-left: 20px;
32-
border-left: 1px solid #ccc;
33-
}
34-
li {
35-
margin: 5px 0;
36-
}
37-
a {
38-
text-decoration: none;
39-
color: #4CAF50;
40-
font-weight: bold;
41-
}
42-
a:hover {
43-
color: #333;
44-
}
45-
.folder::before {
46-
content: "📁 ";
47-
font-size: 16px;
48-
}
49-
.file::before {
50-
content: "📄 ";
51-
font-size: 16px;
52-
}
53-
.container {
54-
max-width: 600px;
55-
margin: 0 auto;
56-
background-color: #fff;
57-
padding: 20px;
58-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
59-
}
60-
</style>
61-
</head>
62-
<body>
63-
<div class="container">
64-
<h1>Project Index</h1>
65-
<ul>
11+
<head>
12+
<meta charset="UTF-8" />
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
14+
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
15+
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
16+
<link
17+
href="https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css"
18+
rel="stylesheet"
19+
type="text/css"
20+
/>
21+
<title>KUIT FE</title>
22+
<style>
23+
body {
24+
font-family: Arial, sans-serif;
25+
margin: 20px;
26+
background-color: #fff;
27+
}
28+
h1 {
29+
color: #1a1a1a;
30+
}
31+
ul {
32+
list-style-type: none;
33+
}
34+
ul ul {
35+
padding-left: 20px;
36+
}
37+
li {
38+
margin: 10px 0;
39+
}
40+
.folder {
41+
font-size: 14px;
42+
color: #1a1a1a;
43+
}
44+
a {
45+
text-decoration: none;
46+
color: #2c2c2c;
47+
}
48+
.container {
49+
max-width: 600px;
50+
margin: 0 auto;
51+
background-color: #fff;
52+
padding: 20px;
53+
}
54+
.tossface {
55+
font-family: Tossface;
56+
}
57+
</style>
58+
</head>
59+
<body>
60+
<div class="container">
61+
<h1>Kuit Frontend Missions ✨</h1>
62+
<ul>
6663
`;
6764

6865
// 주차별로 디렉토리를 탐색
6966
const weeks = fs.readdirSync(baseDir);
7067
weeks.forEach((week) => {
7168
const weekPath = path.join(baseDir, week);
7269
if (fs.lstatSync(weekPath).isDirectory()) {
73-
htmlContent += `<li class="folder">${week}<ul>\n`;
70+
htmlContent += `<li class="folder">
71+
<span class="tossface">📂</span> ${week}
72+
<ul>\n`;
7473

7574
// 주차별 하위 프로젝트 탐색
7675
const projects = fs.readdirSync(weekPath);
7776
projects.forEach((project) => {
7877
const projectPath = path.join(weekPath, project);
7978
if (fs.lstatSync(projectPath).isDirectory()) {
80-
htmlContent += `<li class="file"><a href="/${week}/${project}">${project}</a></li>\n`;
79+
htmlContent += `<li class="tossface">
80+
<a href="KUIT4_Web-FrontEnd/${week}/${project}"
81+
><span class="tossface">📄</span> ${project}</a
82+
>
83+
</li>\n`;
8184
}
8285
});
8386

0 commit comments

Comments
 (0)