Skip to content

Commit c0370df

Browse files
committed
优化项目
1 parent d18d0bb commit c0370df

File tree

20 files changed

+276
-42
lines changed

20 files changed

+276
-42
lines changed

.cloudflare/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Wrangler CLI 的配置文件,用于命令行部署。
1111

1212
```toml
1313
name = "weiz-nav" # 项目名称
14-
compatibility_date = "2024-11-18" # 兼容性日期
14+
compatibility_date = "2025-11-18" # 兼容性日期
1515
pages_build_output_dir = "out" # 构建输出目录
1616
```
1717

@@ -184,8 +184,8 @@ wrangler login
184184

185185
## 相关文档
186186

187-
- [快速开始](../../QUICKSTART.md)
188-
- [完整部署指南](../../DEPLOYMENT.md)
187+
- [快速开始](../.kiro/specs/frontend-navigation-site/QUICKSTART.md)
188+
- [完整部署指南](../.kiro/specs/frontend-navigation-site/DEPLOYMENT.md)
189189
- [GitHub Actions 配置](../.github/CLOUDFLARE_SETUP.md)
190190

191191
## 支持

.kiro/specs/frontend-navigation-site/DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ TTL: 自动
213213

214214
```toml
215215
name = "weiz-nav"
216-
compatibility_date = "2024-11-18"
216+
compatibility_date = "2025-11-18"
217217
pages_build_output_dir = "out"
218218

219219
[build]

.prettierignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 依赖
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# 构建输出
7+
.next
8+
out
9+
build
10+
dist
11+
12+
# 缓存
13+
.cache
14+
*.tsbuildinfo
15+
16+
# 日志
17+
*.log
18+
19+
# 环境变量
20+
.env*.local
21+
22+
# 其他
23+
.DS_Store
24+
*.pem
25+
pnpm-lock.yaml
26+
package-lock.json
27+
yarn.lock

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf",
10+
"bracketSpacing": true,
11+
"jsxSingleQuote": false,
12+
"jsxBracketSameLine": false
13+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
现代化的个人前端导航网站,基于 Next.js 15 构建。
44

5-
> 🚀 **快速部署**:查看 [QUICKSTART.md](./QUICKSTART.md) 了解如何在 5 分钟内部署到 Cloudflare Pages
5+
> 🚀 **快速部署**:查看 [QUICKSTART.md](./.kiro/specs/frontend-navigation-site/QUICKSTART.md) 了解如何在 5 分钟内部署到 Cloudflare Pages
66
77
## 技术栈
88

app/layout.tsx

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,26 @@ import Providers from '@/components/Providers';
44
import '@ant-design/v5-patch-for-react-19';
55

66
export const metadata: Metadata = {
7-
title: '唯知导航',
8-
description: '现代化的个人前端导航网站',
9-
keywords: ['导航', '开发工具', '资源导航', 'weizwz', '唯知为之'],
10-
authors: [{ name: ' weizwz' }],
7+
title: {
8+
default: '唯知导航',
9+
template: '%s | 唯知导航',
10+
},
11+
description: '现代化的个人前端导航网站,提供开发工具、资源导航等功能',
12+
keywords: ['导航', '开发工具', '资源导航', 'weizwz', '唯知为之', '前端导航', '开发者工具'],
13+
authors: [{ name: 'weizwz', url: 'https://github.com/weizwz' }],
14+
creator: 'weizwz',
15+
publisher: 'weizwz',
16+
robots: {
17+
index: true,
18+
follow: true,
19+
googleBot: {
20+
index: true,
21+
follow: true,
22+
'max-video-preview': -1,
23+
'max-image-preview': 'large',
24+
'max-snippet': -1,
25+
},
26+
},
1127
icons: {
1228
icon: [
1329
{ url: '/favicon.ico', sizes: '16x16', type: 'image/x-icon' },
@@ -16,6 +32,32 @@ export const metadata: Metadata = {
1632
shortcut: '/favicon.ico',
1733
apple: '/favicon-128.ico',
1834
},
35+
manifest: '/manifest.json',
36+
openGraph: {
37+
type: 'website',
38+
locale: 'zh_CN',
39+
url: 'https://nav.weizwz.com',
40+
title: '唯知导航',
41+
description: '现代化的个人前端导航网站',
42+
siteName: '唯知导航',
43+
images: [
44+
{
45+
url: '/logo.png',
46+
width: 512,
47+
height: 512,
48+
alt: '唯知导航 Logo',
49+
},
50+
],
51+
},
52+
twitter: {
53+
card: 'summary_large_image',
54+
title: '唯知导航',
55+
description: '现代化的个人前端导航网站',
56+
images: ['/logo.png'],
57+
},
58+
alternates: {
59+
canonical: 'https://nav.weizwz.com',
60+
},
1961
};
2062

2163
export const viewport: Viewport = {

app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use client';
22

33
import React, { useEffect, useState, useCallback } from 'react';
4-
import { FloatButton, Drawer, Button } from 'antd';
5-
import { PlusOutlined, MenuOutlined } from '@ant-design/icons';
4+
import { FloatButton, Drawer } from 'antd';
5+
import { PlusOutlined } from '@ant-design/icons';
66
import { useAppDispatch, useAppSelector } from '@/store/hooks';
77
import { addLink, updateLink, deleteLink, loadLinks } from '@/store/slices/linksSlice';
88
import { storageService } from '@/services/storage';

components/management/DataTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export const DataTable: React.FC<DataTableProps> = ({
335335
current: currentPage,
336336
pageSize: pageSize,
337337
showSizeChanger: true,
338-
showTotal: (total) => {
338+
showTotal: () => {
339339
const categoryCount = treeData.length;
340340
const linkCount = links.length;
341341
return `共 ${categoryCount} 个分类,${linkCount} 条链接`;

components/modals/EditLinkModal.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const EditLinkModal: React.FC<EditLinkModalProps> = ({
3030
}) => {
3131
const [form] = Form.useForm();
3232
const [loading, setLoading] = useState(false);
33-
const [fetchingIcon, setFetchingIcon] = useState(false);
3433
const [iconType, setIconType] = useState<'1' | '2'>('1'); // 1: Favicon, 2: 自定义
3534
const [previewIcon, setPreviewIcon] = useState<string>('');
3635
const [previewBgColor, setPreviewBgColor] = useState<string>(getDefaultColor());
@@ -303,7 +302,6 @@ export const EditLinkModal: React.FC<EditLinkModalProps> = ({
303302
<Input
304303
placeholder="https://example.com"
305304
onChange={handleUrlChange}
306-
disabled={fetchingIcon}
307305
/>
308306
</Form.Item>
309307

components/navigation/CategorySidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const DraggableCategoryItem: React.FC<DraggableCategoryItemProps> = ({
108108
: 'hover:bg-blue-100 dark:hover:bg-blue-500/50 text-gray-600 dark:text-gray-400'
109109
}
110110
`}
111-
onClick={(e) => {
111+
onClick={() => {
112112
// 只有在没有拖拽的情况下才触发点击
113113
if (!isDragging) {
114114
onSelect(category.name);

0 commit comments

Comments
 (0)