Skip to content

Commit f622ae1

Browse files
committed
feat: 将硬编码链接和电子邮件外部化到关于和页脚组件中的配置文件
1 parent c816b29 commit f622ae1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/components/About.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
} from "@ant-design/icons";
99
import { Button } from "antd";
1010

11+
import { config } from "../config";
12+
1113
interface AboutProps {
1214
title?: string;
1315
}
@@ -90,7 +92,7 @@ export function About({ title = "关于我" }: AboutProps) {
9092
size="large"
9193
shape="round"
9294
icon={<MailOutlined />}
93-
href="mailto:[email protected]"
95+
href={config.social.email}
9496
>
9597
邮箱
9698
</Button>
@@ -99,7 +101,7 @@ export function About({ title = "关于我" }: AboutProps) {
99101
size="large"
100102
shape="round"
101103
icon={<EditOutlined />}
102-
href="https://note.weizwz.com/pages/links"
104+
href={config.blog.linksUrl}
103105
target="_blank"
104106
>
105107
留言

app/components/Footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { config } from "../config";
2+
13
export function Footer() {
24
return (
35
<footer className="w-full px-4 md:px-12 py-12 flex flex-col items-center gap-4">
@@ -21,7 +23,7 @@ export function Footer() {
2123
<a target="_blank" href="https://iconify.design/" title="本站图标API使用 iconify">
2224
<img alt="iconify" src="https://img.shields.io/badge/Icon API-iconify-1769AA?logo=iconify&amp;logoColor=fff"/>
2325
</a>
24-
<a target="_blank" href="https://github.com/weizwz" title="本站代码托管于 Github">
26+
<a target="_blank" href={config.social.github} title="本站代码托管于 Github">
2527
<img alt="Github" src="https://img.shields.io/badge/Code-Github-432DD7?logo=github&amp;logoColor=fff"/>
2628
</a>
2729
<a target="_blank" href="https://vercel.com/" title="本站部署于 Vercel">

0 commit comments

Comments
 (0)