chore: encrypt contact info with MD5 to prevent crawler scraping

This commit is contained in:
zguiyang
2026-05-02 09:44:49 +08:00
parent 5b3a3a7480
commit 24332efbac
4 changed files with 64 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
--- ---
import { contactIntents, contactMethods } from '@/lib/data'; import { contactIntents, contactMethods } from "@/lib/data";
import type { Lang } from '@/types/i18n'; import type { Lang } from "@/types/i18n";
interface Props { interface Props {
lang: Lang; lang: Lang;
@@ -8,38 +8,51 @@ interface Props {
} }
const { lang, showIntents = true } = Astro.props; const { lang, showIntents = true } = Astro.props;
const isZh = lang === 'zh'; const isZh = lang === "zh";
--- ---
<section class="page-content-main mt-6 page-surface p-8" id="contact-card"> <section class="page-content-main mt-6 page-surface p-8" id="contact-card">
<h2 class="text-2xl font-bold tracking-tight">{isZh ? '联系我' : 'Contact'}</h2> <h2 class="text-2xl font-bold tracking-tight">
{isZh ? "联系我" : "Contact"}
</h2>
<p class="mt-3 text-sm text-muted-foreground"> <p class="mt-3 text-sm text-muted-foreground">
{isZh {
? '欢迎交流岗位机会、专项协作,或工程实践相关话题。' isZh
: 'Open to role opportunities, scoped collaboration, and engineering discussions.'} ? "欢迎交流岗位机会、专项协作,或工程实践相关话题。"
: "Open to role opportunities, scoped collaboration, and engineering discussions."
}
</p> </p>
{showIntents && ( {
showIntents && (
<div class="mt-5 grid gap-4 md:grid-cols-3"> <div class="mt-5 grid gap-4 md:grid-cols-3">
{contactIntents.map((intent) => ( {contactIntents.map((intent) => (
<article class="rounded-md border border-border/70 p-4"> <article class="rounded-md border border-border/70 p-4">
<h3 class="text-sm font-bold">{intent.title[lang]}</h3> <h3 class="text-sm font-bold">{intent.title[lang]}</h3>
<p class="mt-2 text-sm text-muted-foreground">{intent.description[lang]}</p> <p class="mt-2 text-sm text-muted-foreground">
{intent.description[lang]}
</p>
</article> </article>
))} ))}
</div> </div>
)} )
}
<ul class="mt-6 space-y-3 text-sm"> <ul class="mt-6 space-y-3 text-sm">
{contactMethods.map((method) => ( {
contactMethods.map((method) => (
<li class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-3 last:border-none last:pb-0"> <li class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-3 last:border-none last:pb-0">
<span class="font-semibold text-foreground">{method.label[lang]}</span> <span class="font-semibold text-foreground">
{method.href ? ( {method.label[lang]}
<a href={method.href} target="_blank" rel="noopener noreferrer" class="text-primary hover:text-primary/80 break-all">{method.value}</a> </span>
) : ( <span class="text-muted-foreground break-all font-mono text-xs">
<span class="text-muted-foreground break-all">{method.value}</span> {method.value}
)} </span>
<span class="inline-flex items-center rounded-md bg-muted px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">
MD5
</span>
</li> </li>
))} ))
}
</ul> </ul>
</section> </section>

View File

@@ -151,16 +151,18 @@ export const translations = {
methods: [ methods: [
{ {
label: "Email", label: "Email",
value: "zhaoguiyang18@outlook.com", value: "32df4a784e33b3964f4c06f6c6aeeecd",
icon: "mail", icon: "mail",
link: "mailto:zhaoguiyang18@outlook.com",
}, },
{ label: "WeChat", value: "Joey_Zhao_dev", icon: "wechat" }, {
label: "WeChat",
value: "1b2f7b05fca4d2b892e7fa7741d077ee",
icon: "wechat",
},
{ {
label: "Telegram", label: "Telegram",
value: "joey_zgy", value: "592dff213bb5e79a511c34a37f7edbb5",
icon: "send", icon: "send",
link: "https://t.me/joey_zgy",
}, },
], ],
}, },
@@ -377,16 +379,18 @@ export const translations = {
methods: [ methods: [
{ {
label: "邮箱", label: "邮箱",
value: "zhaoguiyang18@outlook.com", value: "32df4a784e33b3964f4c06f6c6aeeecd",
icon: "mail", icon: "mail",
link: "mailto:zhaoguiyang18@outlook.com",
}, },
{ label: "微信", value: "Joey_Zhao_dev", icon: "wechat" }, {
label: "微信",
value: "1b2f7b05fca4d2b892e7fa7741d077ee",
icon: "wechat",
},
{ {
label: "Telegram", label: "Telegram",
value: "joey_zgy", value: "592dff213bb5e79a511c34a37f7edbb5",
icon: "send", icon: "send",
link: "https://t.me/joey_zgy",
}, },
], ],
}, },

View File

@@ -39,16 +39,14 @@ export const contactIntents: ContactIntent[] = [
export const contactMethods: ContactMethod[] = [ export const contactMethods: ContactMethod[] = [
{ {
label: { en: "Email (Secondary)", zh: "邮箱(备用)" }, label: { en: "Email (Secondary)", zh: "邮箱(备用)" },
value: "zhaoguiyang18@outlook.com", value: "32df4a784e33b3964f4c06f6c6aeeecd",
href: "mailto:zhaoguiyang18@outlook.com",
}, },
{ {
label: { en: "WeChat", zh: "微信" }, label: { en: "WeChat", zh: "微信" },
value: "Joey_Zhao_dev", value: "1b2f7b05fca4d2b892e7fa7741d077ee",
}, },
{ {
label: { en: "Telegram", zh: "Telegram" }, label: { en: "Telegram", zh: "Telegram" },
value: "joey_zgy", value: "592dff213bb5e79a511c34a37f7edbb5",
href: "https://t.me/joey_zgy",
}, },
]; ];

View File

@@ -4,7 +4,7 @@ export const personalInfo: PersonalInfo = {
name: "Joey Z.", name: "Joey Z.",
location: "Chengdu, China", location: "Chengdu, China",
avatar: "https://avatars.githubusercontent.com/u/24975063?v=4", avatar: "https://avatars.githubusercontent.com/u/24975063?v=4",
email: "zhaoguiyang18@outlook.com", email: "32df4a784e33b3964f4c06f6c6aeeecd",
github: "https://github.com/zguiyang", github: "https://github.com/zguiyang",
linkedin: "", linkedin: "",
website: "https://zhaoguiyang.com", website: "https://zhaoguiyang.com",