Skip to content

Commit 4530266

Browse files
authored
Merge pull request #3 from Edit-Mr/master
Migrate Static Redirect Pages to Dynamic GitHub Actions Workflow
2 parents 44d85ae + 2a89e94 commit 4530266

37 files changed

+1442
-2261
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 21
32+
33+
- name: Run build script
34+
run: node build.js
35+
36+
- name: Configure Pages
37+
uses: actions/configure-pages@v5
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: "."
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

404.html

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SITCON 學生計算機年會官網
2+
3+
## 重新導向
4+
5+
若要建立重新導向,請在 `links.json` 中新增一個物件。
6+
7+
```json
8+
{
9+
"paths": ["discord", "dc"],
10+
"url": "https://discord.gg/Cr3xvyj",
11+
"title": "SITCON 學生計算機年會 Discord",
12+
"description": "在 Discord 上與 SITCON 的夥伴們抬槓吧!"
13+
}
14+
```

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="content">
1515
<article class="cinshui">
1616
<p><img alt="SITCON 2015" src="https://farm3.staticflickr.com/2900/14412625957_6b97c8396a_k.jpg"></p>
17-
<p><strong>歡迎來到學生計算機年會!</strong></p>
17+
<h1>歡迎來到學生計算機年會!</h1>
1818
<p>始源於 2012 年暑假,SITCON 從萌芽的那刻起,便由你我這樣的學生自發組成、自主籌備,秉持著以學生為主軸的核心價值,以年會凝聚與傳遞學生的力量。無論是新來乍到的朋友、或是學有所成的夥伴,我們都期待各位能在短暫的年會期間,透過經驗的交流、技術的分享,使資訊技術能被傳承、研究成果能被看見、創意靈感能夠相互激盪,更讓彼此對資訊科學領域有更深入的了解;「學以致用、教學相長」,是社群共同努力的目標。</p>
1919
<p>2014 的年會比起以往,更值得每個人的投入與期待。除了增加報名人數、移師中研院外,我們同時也在思考,如何以學生的力量影響學校、教育、甚至是社會?「學生與創新實作」以及同名的座談會,是今年的籌備團隊與大家共勉,也是身處資訊圈的你我應該關心的議題;多元的議程、彈性的時間,希望每位參與的朋友都能汲取所需,藉由講者的分享拓展己身的資訊視野。首創的主題沙龍,更是這屆 SITCON 的重點活動:在奔波換場之餘、瑣碎空閒之際,何不造訪交誼廳,與各地的夥伴們聚聚呢?</p>
2020
<p>SITCON 學生計算機年會的舉辦,不僅向世界證明了台灣學生的熱情與行動力,更為我們所處的世代賦予了嶄新意義。我們期待小有成就者能在年會中夠分享己身經驗,初來乍到者得以自年會中汲取養分;甚至在會後繼續參與 SITCON 社群,一同在資訊的殿堂中傳承、激盪、啟發。</p>

build.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/** @format */
2+
3+
const fs = require("fs");
4+
const path = require("path");
5+
6+
const links = JSON.parse(fs.readFileSync("links.json", "utf8"));
7+
8+
links.forEach(({ paths, url, title, description }) => {
9+
paths.forEach(linkPath => {
10+
const htmlContent = `<!DOCTYPE html>
11+
<html lang="zh-Hant">
12+
<head>
13+
<meta charset="UTF-8">
14+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
15+
<meta http-equiv="refresh" content="0; url=${url}">
16+
<title>${title || "Redirecting..."}</title>
17+
<meta name="description" content="SITCON (Students’ Information Technology Conference) 是發源自臺灣、由學生自主舉辦的計算機年會與資訊社群。${
18+
description || ""
19+
}">
20+
<meta property="og:title" content="${title || "Redirecting..."}">
21+
<meta property="og:description" content="${description || ""}">
22+
<meta property="og:url" content="${url}">
23+
<link rel="canonical" href="${url}">
24+
</head>
25+
<body>
26+
<p>正在前往 <a href="${url}">${title}</a></p>
27+
</body>
28+
</html>`;
29+
fs.writeFileSync(`${linkPath}.html`, htmlContent, "utf8");
30+
});
31+
});
32+
33+
console.log("HTML files generated successfully.");

cal.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

calendar.html

Lines changed: 0 additions & 57 deletions
This file was deleted.

camp-cal.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

camp-calendar.html

Lines changed: 0 additions & 57 deletions
This file was deleted.

camp/index.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)