更新简历组件,替换项目链接为博客链接,并优化相关链接的渲染逻辑,确保只显示存在的仓库链接。同时,更新简历类型定义,调整链接结构以支持多个仓库信息。

This commit is contained in:
宇阳
2025-09-12 15:39:15 +08:00
parent 42c4cd6eb1
commit 40accba2fa
3 changed files with 17 additions and 17 deletions

View File

@@ -191,8 +191,8 @@ export default ({ data }: { data: Resume }) => {
</a>
)}
{links?.project && (
<a href={links.project} target="_blank" rel="noopener noreferrer" className="flex items-center text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-sm font-medium transition-colors">
{links?.blog && (
<a href={links.blog} target="_blank" rel="noopener noreferrer" className="flex items-center text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-sm font-medium transition-colors">
<FaProjectDiagram className="mr-2" size={16} />
</a>
)}
@@ -308,23 +308,18 @@ export default ({ data }: { data: Resume }) => {
</div>
)}
{!!(project.links || project.repositories)?.length && (
{!!project.repositories?.length && (
<div>
<h5 className="font-bold text-gray-800 dark:text-white mb-1 text-sm"></h5>
<div className="flex flex-wrap gap-2">
{project.links &&
Object.entries(project.links).map(([key, value]) => (
<a key={key} href={value as string} target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs font-medium bg-blue-50 dark:bg-blue-900/30 px-2 py-1 rounded transition-colors">
{key === 'preview' ? '项目预览' : key === 'website' ? '项目官网' : key === 'docs' ? '项目文档' : key === 'api' ? '项目接口' : key === 'dashboard' ? '项目后台' : key}
{project.repositories?.map((item, index) => (
<div key={index} className="flex items-center">
<span>{item.name}</span>
<a href={item.url as string} target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs font-medium bg-blue-50 dark:bg-blue-900/30 px-2 py-1 rounded transition-colors">
{item.url}
</a>
))}
{project.repositories &&
Object.entries(project.repositories).map(([key, value]) => (
<a key={key} href={value as string} target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs font-medium bg-blue-50 dark:bg-blue-900/30 px-2 py-1 rounded transition-colors">
{key === 'frontend' ? '前端仓库' : key === 'admin' ? '控制端仓库' : '后端仓库'}
</a>
))}
</div>
))}
</div>
</div>
)}

View File

@@ -20,7 +20,7 @@ export interface Resume {
links?: {
github?: string;
csdn?: string;
project?: string;
blog?: string;
};
skills?: string[];
workExperience?: Array<{
@@ -43,7 +43,7 @@ export interface Resume {
};
highlights?: string[];
links?: Record<string, string>;
repositories?: Record<string, string>;
repositories?: { name: string; url: string }[];
achievements?: string | string[];
challenges?: string[];
responsibilities?: string[];

5
更新日志.md Normal file
View File

@@ -0,0 +1,5 @@
一、调整关于我页面技术栈容器宽度
二、调整我的履历页面 项目描述、亮点和难点的渲染逻辑,确保在有内容时才显示相关信息。
三、解决移动端点击导航跳转到分类 BUG