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,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";
---
<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>
<p class="mt-3 text-sm text-muted-foreground">
{isZh
? '欢迎交流岗位机会、专项协作,或工程实践相关话题。'
: 'Open to role opportunities, scoped collaboration, and engineering discussions.'}
</p>
<h2 class="text-2xl font-bold tracking-tight">
{isZh ? "联系我" : "Contact"}
</h2>
<p class="mt-3 text-sm text-muted-foreground">
{
isZh
? "欢迎交流岗位机会、专项协作,或工程实践相关话题。"
: "Open to role opportunities, scoped collaboration, and engineering discussions."
}
</p>
{showIntents && (
<div class="mt-5 grid gap-4 md:grid-cols-3">
{contactIntents.map((intent) => (
<article class="rounded-md border border-border/70 p-4">
<h3 class="text-sm font-bold">{intent.title[lang]}</h3>
<p class="mt-2 text-sm text-muted-foreground">{intent.description[lang]}</p>
</article>
))}
</div>
)}
{
showIntents && (
<div class="mt-5 grid gap-4 md:grid-cols-3">
{contactIntents.map((intent) => (
<article class="rounded-md border border-border/70 p-4">
<h3 class="text-sm font-bold">{intent.title[lang]}</h3>
<p class="mt-2 text-sm text-muted-foreground">
{intent.description[lang]}
</p>
</article>
))}
</div>
)
}
<ul class="mt-6 space-y-3 text-sm">
{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">
<span class="font-semibold text-foreground">{method.label[lang]}</span>
{method.href ? (
<a href={method.href} target="_blank" rel="noopener noreferrer" class="text-primary hover:text-primary/80 break-all">{method.value}</a>
) : (
<span class="text-muted-foreground break-all">{method.value}</span>
)}
</li>
))}
</ul>
<ul class="mt-6 space-y-3 text-sm">
{
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">
<span class="font-semibold text-foreground">
{method.label[lang]}
</span>
<span class="text-muted-foreground break-all font-mono text-xs">
{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>
))
}
</ul>
</section>

View File

@@ -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",
},
],
},

View File

@@ -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",
},
];

View File

@@ -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",