diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts index e396a84..cf635d4 100644 --- a/src/i18n/translations.ts +++ b/src/i18n/translations.ts @@ -112,11 +112,21 @@ export const translations = { contact: { title: 'Contact Me 📫', warning: 'Since everyone\'s time is valuable, please add a note when contacting me, such as: collaboration, consultation, project requirements, etc. I may not reply to or might ignore messages without notes. Thank you for your cooperation!', - methods: { - email: 'Email: zhaoguiyang18@gmail.com', - qq: 'QQ: 2770723534', - wechat: 'WeChat: JoyCodeing', - }, + methods: [ + { label: 'Email', value: 'zhaoguiyang18@gmail.com', icon: 'mail', link: 'mailto:zhaoguiyang18@gmail.com' }, + { label: 'WeChat', value: 'JoyCodeing', icon: 'wechat' }, + { label: 'QQ', value: '2770723534', icon: 'qq' }, + { label: 'Telegram', value: '@joyzhao', icon: 'send', link: 'https://t.me/joyzhao' }, + ], + }, + socials: { + title: 'Community & Media 🌐', + items: [ + { label: 'GitHub', value: 'github.com/zhaoguiyang', icon: 'github', link: 'https://github.com/zhaoguiyang' }, + { label: 'Twitter / X', value: '@joyzhao', icon: 'twitter', link: 'https://twitter.com/joyzhao' }, + { label: 'LinkedIn', value: 'linkedin.com/in/zhaoguiyang', icon: 'linkedin', link: 'https://linkedin.com/in/zhaoguiyang' }, + { label: 'Blog', value: 'zhaoguiyang.site', icon: 'globe', link: 'https://zhaoguiyang.site' }, + ], }, }, home: { @@ -289,11 +299,21 @@ export const translations = { contact: { title: '联系我 📫', warning: '由于大家的时间都很宝贵,所以请在联系我时添加备注,如:合作、咨询、项目需求等,不予备注的我可能不会回复或直接忽略,谢谢合作!', - methods: { - email: '邮箱:zhaoguiyang18@gmail.com', - qq: 'QQ: 2770723534', - wechat: '微信:JoyCodeing', - }, + methods: [ + { label: '邮箱', value: 'zhaoguiyang18@gmail.com', icon: 'mail', link: 'mailto:zhaoguiyang18@gmail.com' }, + { label: '微信', value: 'JoyCodeing', icon: 'wechat' }, + { label: 'QQ', value: '2770723534', icon: 'qq' }, + { label: 'Telegram', value: '@joyzhao', icon: 'send', link: 'https://t.me/joyzhao' }, + ], + }, + socials: { + title: '社区与媒体 🌐', + items: [ + { label: 'GitHub', value: 'github.com/zhaoguiyang', icon: 'github', link: 'https://github.com/zhaoguiyang' }, + { label: 'Twitter / X', value: '@joyzhao', icon: 'twitter', link: 'https://twitter.com/joyzhao' }, + { label: 'LinkedIn', value: 'linkedin.com/in/zhaoguiyang', icon: 'linkedin', link: 'https://linkedin.com/in/zhaoguiyang' }, + { label: 'Blog', value: 'zhaoguiyang.site', icon: 'globe', link: 'https://zhaoguiyang.site' }, + ], }, }, home: { diff --git a/src/pages/about.astro b/src/pages/about.astro index d043991..ac1dc95 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -7,7 +7,29 @@ import HighlightBox from "@/components/markdown/HighlightBox.astro"; import { useTranslations } from "@/i18n/utils"; import type { Lang } from "@/types/i18n"; import { defaultLang } from "@/i18n/ui"; -import { Sparkles, Heart, Zap, Mail, MessageSquare } from "lucide-react"; +import { + Sparkles, + Heart, + Zap, + Mail, + MessageSquare, + Send, + Github, + Twitter, + Linkedin, + Globe +} from "lucide-react"; + +const IconMap: Record = { + mail: Mail, + wechat: MessageSquare, + qq: MessageSquare, // Lucide doesn't have QQ, using MessageSquare + send: Send, + github: Github, + twitter: Twitter, + linkedin: Linkedin, + globe: Globe, +}; const lang = (Astro.currentLocale as Lang) || defaultLang; const t = useTranslations(lang); @@ -83,14 +105,13 @@ const pageTitle = t("about.title"); {t('about.skills.mastered.title')} - +
@@ -98,65 +119,95 @@ const pageTitle = t("about.title"); {t('about.skills.learning.title')} -
    +
    {(t('about.skills.learning.items') as unknown as string[]).map((item: string) => ( -
  • - - {item} -
  • +
    + {item} +
    ))} -
+
-
-

+
+

+ {t('about.interests.title')}

-
+
    {(t('about.interests.items') as unknown as any[]).map((item) => ( -
    -

    {item.title}

    -

    {item.content}

    -
    +
  • +
    +
    + {item.title} +

    {item.content}

    +
    +
  • ))} +
+
+ + +
+

+ + {t('about.socials.title')} +

+
+ {(t('about.socials.items') as unknown as any[]).map((item) => { + const Icon = IconMap[item.icon] || Globe; + return ( + + + {item.label} + + ); + })}
-
-
- -
- -
+
+

- + {t('about.contact.title')}

- - +

{t('about.contact.warning')} - +

+
-
-
- - Email - {(t('about.contact.methods.email') as string).split(':')[1] || (t('about.contact.methods.email') as string).split(': ')[1]} -
-
- QQ - QQ - {(t('about.contact.methods.qq') as string).split(':')[1] || (t('about.contact.methods.qq') as string).split(': ')[1]} -
-
- - WeChat - {(t('about.contact.methods.wechat') as string).split(':')[1] || (t('about.contact.methods.wechat') as string).split(': ')[1]} -
-
+
+ {(t('about.contact.methods') as unknown as any[]).map((method) => { + const Icon = IconMap[method.icon] || MessageSquare; + const content = ( +
+
+ +
+
+ {method.label} + {method.value} +
+
+ ); + + if (method.link) { + return ( + + {content} + + ); + } + return
{content}
; + })}
diff --git a/src/pages/zh/about.astro b/src/pages/zh/about.astro index 6ff8692..009c28d 100644 --- a/src/pages/zh/about.astro +++ b/src/pages/zh/about.astro @@ -7,7 +7,29 @@ import HighlightBox from "@/components/markdown/HighlightBox.astro"; import { useTranslations } from "@/i18n/utils"; import type { Lang } from "@/types/i18n"; import { defaultLang } from "@/i18n/ui"; -import { Sparkles, Heart, Zap, Mail, MessageSquare } from "lucide-react"; +import { + Sparkles, + Heart, + Zap, + Mail, + MessageSquare, + Send, + Github, + Twitter, + Linkedin, + Globe +} from "lucide-react"; + +const IconMap: Record = { + mail: Mail, + wechat: MessageSquare, + qq: MessageSquare, // Lucide doesn't have QQ, using MessageSquare + send: Send, + github: Github, + twitter: Twitter, + linkedin: Linkedin, + globe: Globe, +}; const lang = (Astro.currentLocale as Lang) || 'zh'; const t = useTranslations(lang); @@ -83,14 +105,13 @@ const pageTitle = t("about.title"); {t('about.skills.mastered.title')}

-
    +
    {(t('about.skills.mastered.items') as unknown as string[]).map((item: string) => ( -
  • - - {item} -
  • +
    + {item} +
    ))} -
+
@@ -98,65 +119,95 @@ const pageTitle = t("about.title"); {t('about.skills.learning.title')} -
    +
    {(t('about.skills.learning.items') as unknown as string[]).map((item: string) => ( -
  • - - {item} -
  • +
    + {item} +
    ))} -
+
-
-

+
+

+ {t('about.interests.title')}

-
+
    {(t('about.interests.items') as unknown as any[]).map((item) => ( -
    -

    {item.title}

    -

    {item.content}

    -
    +
  • +
    +
    + {item.title} +

    {item.content}

    +
    +
  • ))} +
+
+ + +
+

+ + {t('about.socials.title')} +

+
+ {(t('about.socials.items') as unknown as any[]).map((item) => { + const Icon = IconMap[item.icon] || Globe; + return ( + + + {item.label} + + ); + })}
-
-
- -
- -
+
+

- + {t('about.contact.title')}

- - +

{t('about.contact.warning')} - +

+
-
-
- - Email - {(t('about.contact.methods.email') as string).split(':')[1] || (t('about.contact.methods.email') as string).split(': ')[1]} -
-
- QQ - QQ - {(t('about.contact.methods.qq') as string).split(':')[1] || (t('about.contact.methods.qq') as string).split(': ')[1]} -
-
- - WeChat - {(t('about.contact.methods.wechat') as string).split(':')[1] || (t('about.contact.methods.wechat') as string).split(': ')[1]} -
-
+
+ {(t('about.contact.methods') as unknown as any[]).map((method) => { + const Icon = IconMap[method.icon] || MessageSquare; + const content = ( +
+
+ +
+
+ {method.label} + {method.value} +
+
+ ); + + if (method.link) { + return ( + + {content} + + ); + } + return
{content}
; + })}