Skip to content

Commit 65da7ba

Browse files
committed
Fix build
1 parent a2b9a6a commit 65da7ba

28 files changed

+120
-630
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,56 +29,28 @@ jobs:
2929
build:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v6
34-
- name: Detect package manager
35-
id: detect-package-manager
36-
run: |
37-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
38-
echo "manager=yarn" >> $GITHUB_OUTPUT
39-
echo "command=install" >> $GITHUB_OUTPUT
40-
echo "runner=yarn" >> $GITHUB_OUTPUT
41-
exit 0
42-
elif [ -f "${{ github.workspace }}/package.json" ]; then
43-
echo "manager=npm" >> $GITHUB_OUTPUT
44-
echo "command=ci" >> $GITHUB_OUTPUT
45-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46-
exit 0
47-
else
48-
echo "Unable to determine package manager"
49-
exit 1
50-
fi
51-
- name: Setup Node
52-
uses: actions/setup-node@v4
53-
with:
54-
node-version: "24"
55-
cache: ${{ steps.detect-package-manager.outputs.manager }}
56-
- name: Setup Pages
57-
uses: actions/configure-pages@v5
58-
with:
59-
# Automatically inject basePath in your Next.js configuration file and disable
60-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61-
#
62-
# You may remove this line if you want to manage the configuration yourself.
63-
static_site_generator: next
64-
- name: Restore cache
65-
uses: actions/cache@v4
66-
with:
67-
path: |
68-
.next/cache
69-
# Generate a new cache whenever packages or source files change.
70-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
71-
# If source files changed but packages didn't, rebuild from a prior cache.
72-
restore-keys: |
73-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
74-
- name: Install dependencies
75-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
76-
- name: Build with Next.js
77-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
78-
- name: Upload artifact
79-
uses: actions/upload-pages-artifact@v3
80-
with:
81-
path: ./out
32+
- uses: actions/checkout@v6
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10
36+
- uses: actions/setup-node@v6
37+
with:
38+
node-version: '24.x'
39+
cache: 'pnpm'
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
with:
43+
# Automatically inject basePath in your Next.js configuration file and disable
44+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
45+
#
46+
# You may remove this line if you want to manage the configuration yourself.
47+
static_site_generator: next
48+
- run: pnpm install --frozen-lockfile
49+
- run: pnpm next build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./out
8254

8355
# Deployment job
8456
deploy:
@@ -88,6 +60,6 @@ jobs:
8860
runs-on: ubuntu-latest
8961
needs: build
9062
steps:
91-
- name: Deploy to GitHub Pages
92-
id: deployment
93-
uses: actions/deploy-pages@v4
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

README.md

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# 音典網頁版 (Yindian Web)
1+
# 音典網頁版
22

3-
漢字音典(Yindian)是全面收集漢字讀音的資料庫。它源自 Maigo 製作的 MCPDict,是最早的漢字讀音查詢工具之一。此後,由眾多專家聯手,不斷收集整理大量漢字讀音資料,製作了漢字音典 APP。nk2028 基於漢字音典 APP 發佈了音典網頁版,讓更多使用者能夠方便地查詢漢字在不同時代、不同地區的讀音。
3+
漢字音典是全面收集漢字讀音的資料庫。它源自 Maigo 製作的 [MCPDict](https://github.com/MaigoAkisame/MCPDict),是最早的漢字讀音查詢工具之一。此後,由眾多專家聯手,不斷收集整理大量漢字讀音資料,製作了[漢字音典 APP](https://github.com/osfans/MCPDict)。nk2028 基於漢字音典 APP 發佈了音典網頁版,讓更多使用者能夠方便地查詢漢字在不同時代、不同地區的讀音。
44

55
## 功能特點
66

7-
- **千餘種語言變體**: 收錄約 2400 種語言變體,涵蓋上古音、中古音、近代音及現代各地方言
7+
- **千餘種語言變體**: 收錄超過 2400 種語言變體,涵蓋上古音、中古音、近代音及現代方言
88
- **多音字支持**: 完整顯示漢字的所有讀音,包括注釋說明,幫助區分不同用法
99
- **廣韻字段定制**: 支持自定義廣韻數據顯示字段,包括切韻拼音、各家擬音、音系描述、反切等 24 個字段
1010
- **多語言界面**: 支持繁體中文、簡體中文、英文、日文四種界面語言
@@ -14,10 +14,8 @@
1414
## 技術棧
1515

1616
- **前端框架**: React 19 + TypeScript
17-
- **樣式**: Tailwind CSS 4
18-
- **UI 組件**: shadcn/ui
19-
- **路由**: Wouter
20-
- **構建工具**: Vite
17+
- **樣式**: Tailwind CSS
18+
- **構建工具**: Next.js
2119

2220
## 項目結構
2321

@@ -43,52 +41,22 @@ client/
4341
pnpm install
4442

4543
# 啟動開發服務器
46-
pnpm dev
44+
pnpm next dev
4745

4846
# 構建生產版本
49-
pnpm build
47+
pnpm next build
5048

5149
# 預覽生產構建
52-
pnpm preview
50+
pnpm next start
5351
```
5452

5553
## GitHub Pages 部署
5654

5755
本項目已配置 GitHub Actions 自動部署。推送到 `main` 分支時將自動構建並部署到 GitHub Pages。
5856

59-
### 配置步驟
60-
61-
1. 在 GitHub 倉庫設置中啟用 GitHub Pages
62-
- 進入 Settings > Pages
63-
- Source 選擇 "GitHub Actions"
64-
65-
2. 如果部署到子路徑(如 `username.github.io/yindian-manus/`),需要設置環境變數:
66-
-`.github/workflows/deploy.yml` 中的 Build 步驟添加:
67-
```yaml
68-
- name: Build
69-
run: pnpm build
70-
env:
71-
NODE_ENV: production
72-
BASE_PATH: /yindian-manus/ # 修改為你的倉庫名稱
73-
```
74-
75-
3. 如果部署到根域名(如 `yindian.example.com`),不需要設置 BASE_PATH,預設為 `/`
76-
77-
### 手動部署
78-
79-
```bash
80-
# 構建(子路徑部署)
81-
BASE_PATH=/yindian-manus/ pnpm build
82-
83-
# 構建(根域名部署)
84-
pnpm build
85-
86-
# 構建輸出在 dist/public/ 目錄
87-
```
88-
8957
## GitHub 仓庫
9058

91-
- **前端**: https://github.com/nk2028/yindian-manus
59+
- **前端**: https://github.com/nk2028/yindian
9260
- **后端**: https://github.com/nk2028/yindian-server
9361

9462
## 相關項目
@@ -107,7 +75,7 @@ pnpm build
10775

10876
## 反饋問題
10977

110-
- 在 https://github.com/nk2028/yindian-manus/issues 開 issue
78+
-https://github.com/nk2028/yindian/issues 開 issue
11179
- Telegram 群組: https://t.me/nk2028
11280
- 發送電郵至: support@nk2028.shn.hk
11381
- QQ 找綾香
@@ -117,7 +85,3 @@ pnpm build
11785
- Maigo: MCPDict 原作者
11886
- 漢字音典 APP 開發團隊
11987
- nk2028: 音典網頁版開發維護
120-
121-
## 許可證
122-
123-
本項目基於開源協議發布,具體許可證信息請參考 LICENSE 文件。

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { NextConfig } from "next";
33
const nextConfig: NextConfig = {
44
/* config options here */
55
reactCompiler: true,
6+
basePath: '/yindian',
67
};
78

89
export default nextConfig;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"react": "19.2.3",
1818
"react-dom": "19.2.3",
1919
"sonner": "^2.0.7",
20-
"tailwind-merge": "^3.4.0",
21-
"wouter": "^3.9.0"
20+
"tailwind-merge": "^3.4.0"
2221
},
2322
"devDependencies": {
2423
"@tailwindcss/postcss": "^4",

pnpm-lock.yaml

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

src/app/fonts.css

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,64 @@
22
@font-face {
33
font-family: 'Charis SIL';
44
src: local('Charis SIL'),
5-
url('/fonts/CharisSIL/CharisSIL-Regular.woff2') format('woff2'),
6-
url('/fonts/CharisSIL/CharisSIL-Regular.ttf') format('truetype');
5+
url('/yindian/fonts/CharisSIL/CharisSIL-Regular.woff2') format('woff2'),
6+
url('/yindian/fonts/CharisSIL/CharisSIL-Regular.ttf') format('truetype');
77
font-weight: normal;
88
font-style: normal;
99
}
1010

1111
@font-face {
1212
font-family: 'Charis SIL';
1313
src: local('Charis SIL Italic'),
14-
url('/fonts/CharisSIL/CharisSIL-Italic.woff2') format('woff2'),
15-
url('/fonts/CharisSIL/CharisSIL-Italic.ttf') format('truetype');
14+
url('/yindian/fonts/CharisSIL/CharisSIL-Italic.woff2') format('woff2'),
15+
url('/yindian/fonts/CharisSIL/CharisSIL-Italic.ttf') format('truetype');
1616
font-weight: normal;
1717
font-style: italic;
1818
}
1919

2020
@font-face {
2121
font-family: 'Charis SIL';
2222
src: local('Charis SIL Bold'),
23-
url('/fonts/CharisSIL/CharisSIL-Bold.woff2') format('woff2'),
24-
url('/fonts/CharisSIL/CharisSIL-Bold.ttf') format('truetype');
23+
url('/yindian/fonts/CharisSIL/CharisSIL-Bold.woff2') format('woff2'),
24+
url('/yindian/fonts/CharisSIL/CharisSIL-Bold.ttf') format('truetype');
2525
font-weight: bold;
2626
font-style: normal;
2727
}
2828

2929
@font-face {
3030
font-family: 'Charis SIL';
3131
src: local('Charis SIL Bold Italic'),
32-
url('/fonts/CharisSIL/CharisSIL-BoldItalic.woff2') format('woff2'),
33-
url('/fonts/CharisSIL/CharisSIL-BoldItalic.ttf') format('truetype');
32+
url('/yindian/fonts/CharisSIL/CharisSIL-BoldItalic.woff2') format('woff2'),
33+
url('/yindian/fonts/CharisSIL/CharisSIL-BoldItalic.ttf') format('truetype');
3434
font-weight: bold;
3535
font-style: italic;
3636
}
3737

3838
/* SBB Web Font Faces */
3939
@font-face {
4040
font-family: 'SBB';
41-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Thin.woff2') format('woff2');
41+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Thin.woff2') format('woff2');
4242
font-weight: 100;
4343
font-style: normal;
4444
}
4545

4646
@font-face {
4747
font-family: 'SBB';
48-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Light.woff2') format('woff2');
48+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Light.woff2') format('woff2');
4949
font-weight: 300;
5050
font-style: normal;
5151
}
5252

5353
@font-face {
5454
font-family: 'SBB';
55-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Roman.woff2') format('woff2');
55+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Roman.woff2') format('woff2');
5656
font-weight: 400;
5757
font-style: normal;
5858
}
5959

6060
@font-face {
6161
font-family: 'SBB';
62-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Bold.woff2') format('woff2');
62+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Bold.woff2') format('woff2');
6363
font-weight: 700;
6464
font-style: normal;
6565
}

0 commit comments

Comments
 (0)