Skip to content

Commit d988fa1

Browse files
committed
feat: gh-pages banner 별도 배포 설정
1 parent 8615200 commit d988fa1

19 files changed

+255
-9
lines changed

dist/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "LinKU",
44
"description": "건국대학교 학생들을 위한 건국대, 건대 교내외 페이지 모음 링쿠, LinKU",
5-
"version": "1.1.32",
5+
"version": "1.1.34",
66
"action": {
77
"default_popup": "index.html"
88
},

gh-pages/assets/icon128.png

5.8 KB
Loading

gh-pages/assets/icon16.png

687 Bytes
Loading

gh-pages/assets/icon32.png

1.45 KB
Loading

gh-pages/assets/icon48.png

2.24 KB
Loading

gh-pages/assets/icon64.png

2.96 KB
Loading

gh-pages/banners/banner.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"banners": [
3+
{
4+
"img": "kuit_banner.png",
5+
"alt": "KUIT Banner",
6+
"link": "https://www.google.com"
7+
},
8+
{
9+
"img": "kuit_banner2.png",
10+
"alt": "KUIT Banner2",
11+
"link": "https://www.google.com"
12+
},
13+
{
14+
"img": "makers_banner.png",
15+
"alt": "Makers Banner3",
16+
"link": "https://www.google.com"
17+
}
18+
]
19+
}

gh-pages/banners/kuit_banner.png

34.2 KB
Loading

gh-pages/banners/kuit_banner2.png

144 KB
Loading

gh-pages/banners/makers_banner.png

133 KB
Loading

gh-pages/index.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gh-pages/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="ko">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic" rel="stylesheet" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<meta name="description" content="건국대학교 학생들을 위한 건국대, 건대 교내외 페이지 모음 링쿠, LinKU" />
9+
<title>LinKU</title>
10+
<script type="module" crossorigin src="./index.js"></script>
11+
<link rel="stylesheet" crossorigin href="./index.css">
12+
</head>
13+
14+
<body>
15+
<div id="root"></div>
16+
</body>
17+
18+
</html>

gh-pages/index.js

Lines changed: 154 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gh-pages/konkuk_logo.png

9.13 KB
Loading

gh-pages/manifest.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "LinKU",
4+
"description": "건국대학교 학생들을 위한 건국대, 건대 교내외 페이지 모음 링쿠, LinKU",
5+
"version": "1.1.34",
6+
"action": {
7+
"default_popup": "index.html"
8+
},
9+
"icons": {
10+
"16": "assets/icon16.png",
11+
"32": "assets/icon32.png",
12+
"48": "assets/icon48.png",
13+
"64": "assets/icon64.png",
14+
"128": "assets/icon128.png"
15+
}
16+
}

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "LinKU",
44
"description": "건국대학교 학생들을 위한 건국대, 건대 교내외 페이지 모음 링쿠, LinKU",
5-
"version": "1.1.32",
5+
"version": "1.1.34",
66
"action": {
77
"default_popup": "index.html"
88
},

src/assets/banners/banner.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"banners": [
3+
{
4+
"img": "kuit_banner.png",
5+
"alt": "KUIT Banner",
6+
"link": "https://www.google.com"
7+
},
8+
{
9+
"img": "kuit_banner2.png",
10+
"alt": "KUIT Banner2",
11+
"link": "https://www.google.com"
12+
},
13+
{
14+
"img": "makers_banner.png",
15+
"alt": "Makers Banner3",
16+
"link": "https://www.google.com"
17+
}
18+
]
19+
}

tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
"@/*": ["./src/*"]
3030
}
3131
},
32-
"include": ["src"]
32+
"include": ["src", "scripts", "vite-plugin-copy-banners.js"]
3333
}

vite.config.ts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ import react from "@vitejs/plugin-react-swc";
33
import tailwindcss from "@tailwindcss/vite";
44
import path from "path";
55
import svgr from "vite-plugin-svgr";
6+
import fs from "fs";
67

78
export default defineConfig(({ mode }) => {
89
return {
9-
plugins: [react(), tailwindcss(), svgr()],
10+
plugins: [
11+
react(),
12+
tailwindcss(),
13+
svgr(),
14+
mode === "gh-pages" && copyBannersForGhPages(),
15+
],
1016
resolve: {
1117
alias: {
1218
"@": path.resolve(__dirname, "./src"),
@@ -27,12 +33,25 @@ export default defineConfig(({ mode }) => {
2733
chunkFileNames: "[name].js",
2834
entryFileNames: "[name].js",
2935
},
30-
...(mode === "gh-pages"
31-
? {}
32-
: {
33-
external: (id) => id.includes("src/assets/banners"),
34-
}),
3536
},
3637
},
3738
};
3839
});
40+
41+
function copyBannersForGhPages() {
42+
return {
43+
name: "copy-banners-gh-pages", // 플러그인 이름
44+
writeBundle() {
45+
const sourceDir = path.resolve(__dirname, "src/assets/banners"); // 복사할 폴더 경로
46+
const targetDir = path.resolve(__dirname, "gh-pages/banners"); // 대상 경로
47+
48+
if (fs.existsSync(sourceDir)) {
49+
fs.mkdirSync(targetDir, { recursive: true }); // 대상 디렉토리 생성
50+
fs.cpSync(sourceDir, targetDir, { recursive: true }); // 파일 복사
51+
console.log(`Copied banners from ${sourceDir} to ${targetDir}`);
52+
} else {
53+
console.warn(`Source directory ${sourceDir} does not exist.`);
54+
}
55+
},
56+
};
57+
}

0 commit comments

Comments
 (0)