mirror of
https://github.com/LiuYuYang01/ThriveX-Blog.git
synced 2026-05-07 22:27:37 +08:00
更新简历组件,替换项目链接为博客链接,并优化相关链接的渲染逻辑,确保只显示存在的仓库链接。同时,更新简历类型定义,调整链接结构以支持多个仓库信息。
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
4
src/types/app/resume.d.ts
vendored
4
src/types/app/resume.d.ts
vendored
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user