From 24332efbac0b5a28bd2e00f8b16bac358f3b040e Mon Sep 17 00:00:00 2001 From: zguiyang Date: Sat, 2 May 2026 09:44:49 +0800 Subject: [PATCH] chore: encrypt contact info with MD5 to prevent crawler scraping --- src/components/ContactCard.astro | 79 +++++++++++++++++++------------- src/i18n/translations.ts | 24 ++++++---- src/lib/data/contact.ts | 8 ++-- src/lib/data/personal-info.ts | 2 +- 4 files changed, 64 insertions(+), 49 deletions(-) diff --git a/src/components/ContactCard.astro b/src/components/ContactCard.astro index 6817b38..156e4e0 100644 --- a/src/components/ContactCard.astro +++ b/src/components/ContactCard.astro @@ -1,45 +1,58 @@ --- -import { contactIntents, contactMethods } from '@/lib/data'; -import type { Lang } from '@/types/i18n'; +import { contactIntents, contactMethods } from "@/lib/data"; +import type { Lang } from "@/types/i18n"; interface Props { - lang: Lang; - showIntents?: boolean; + lang: Lang; + showIntents?: boolean; } const { lang, showIntents = true } = Astro.props; -const isZh = lang === 'zh'; +const isZh = lang === "zh"; ---
-

{isZh ? '联系我' : 'Contact'}

-

- {isZh - ? '欢迎交流岗位机会、专项协作,或工程实践相关话题。' - : 'Open to role opportunities, scoped collaboration, and engineering discussions.'} -

+

+ {isZh ? "联系我" : "Contact"} +

+

+ { + isZh + ? "欢迎交流岗位机会、专项协作,或工程实践相关话题。" + : "Open to role opportunities, scoped collaboration, and engineering discussions." + } +

- {showIntents && ( -
- {contactIntents.map((intent) => ( -
-

{intent.title[lang]}

-

{intent.description[lang]}

-
- ))} -
- )} + { + showIntents && ( +
+ {contactIntents.map((intent) => ( +
+

{intent.title[lang]}

+

+ {intent.description[lang]} +

+
+ ))} +
+ ) + } - +
diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts index 0d3d36d..7ee64c3 100644 --- a/src/i18n/translations.ts +++ b/src/i18n/translations.ts @@ -151,16 +151,18 @@ export const translations = { methods: [ { label: "Email", - value: "zhaoguiyang18@outlook.com", + value: "32df4a784e33b3964f4c06f6c6aeeecd", icon: "mail", - link: "mailto:zhaoguiyang18@outlook.com", }, - { label: "WeChat", value: "Joey_Zhao_dev", icon: "wechat" }, + { + label: "WeChat", + value: "1b2f7b05fca4d2b892e7fa7741d077ee", + icon: "wechat", + }, { label: "Telegram", - value: "joey_zgy", + value: "592dff213bb5e79a511c34a37f7edbb5", icon: "send", - link: "https://t.me/joey_zgy", }, ], }, @@ -377,16 +379,18 @@ export const translations = { methods: [ { label: "邮箱", - value: "zhaoguiyang18@outlook.com", + value: "32df4a784e33b3964f4c06f6c6aeeecd", icon: "mail", - link: "mailto:zhaoguiyang18@outlook.com", }, - { label: "微信", value: "Joey_Zhao_dev", icon: "wechat" }, + { + label: "微信", + value: "1b2f7b05fca4d2b892e7fa7741d077ee", + icon: "wechat", + }, { label: "Telegram", - value: "joey_zgy", + value: "592dff213bb5e79a511c34a37f7edbb5", icon: "send", - link: "https://t.me/joey_zgy", }, ], }, diff --git a/src/lib/data/contact.ts b/src/lib/data/contact.ts index 14648c8..4358b94 100644 --- a/src/lib/data/contact.ts +++ b/src/lib/data/contact.ts @@ -39,16 +39,14 @@ export const contactIntents: ContactIntent[] = [ export const contactMethods: ContactMethod[] = [ { label: { en: "Email (Secondary)", zh: "邮箱(备用)" }, - value: "zhaoguiyang18@outlook.com", - href: "mailto:zhaoguiyang18@outlook.com", + value: "32df4a784e33b3964f4c06f6c6aeeecd", }, { label: { en: "WeChat", zh: "微信" }, - value: "Joey_Zhao_dev", + value: "1b2f7b05fca4d2b892e7fa7741d077ee", }, { label: { en: "Telegram", zh: "Telegram" }, - value: "joey_zgy", - href: "https://t.me/joey_zgy", + value: "592dff213bb5e79a511c34a37f7edbb5", }, ]; diff --git a/src/lib/data/personal-info.ts b/src/lib/data/personal-info.ts index 3bf919a..d9c10ff 100644 --- a/src/lib/data/personal-info.ts +++ b/src/lib/data/personal-info.ts @@ -4,7 +4,7 @@ export const personalInfo: PersonalInfo = { name: "Joey Z.", location: "Chengdu, China", avatar: "https://avatars.githubusercontent.com/u/24975063?v=4", - email: "zhaoguiyang18@outlook.com", + email: "32df4a784e33b3964f4c06f6c6aeeecd", github: "https://github.com/zguiyang", linkedin: "", website: "https://zhaoguiyang.com",