Files
personal/app/(site)/page.tsx
T
virtheart 7744a6b420 feat: SEO 商用化 — robots/sitemap/OG/结构化数据 + 服务清单内置
- robots.txt:禁 /virtheart /api /unlock,含 sitemap 指向
- sitemap.xml:动态生成(首页 + 服务页 + 已发布作品详情)
- metadata:metadataBase/title template/keywords/canonical/OG/Twitter
  卡片/apple-icon,全部后台可改(site_title/description/keywords)
- search_verification 字段:百度站长验证 meta(后台填入即生效)
- JSON-LD:首页 Person 实体 + 服务页 ProfessionalService/ Offer
- og.png(1200×630)与 icon/apple-icon 品牌图(scripts/gen-brand-images.py)
- 页脚 ICP 备案号位(icp_beian,后台填入即显示,链工信部)
- 服务清单内置 7 项(Web/小程序、AI 应用、Flutter、Java/Go、
  产品设计、全栈交付、技术咨询),价格一律面议,DB 种子幂等

SEO 部署侧待办:百度/搜狗/360/Bing 站长平台提交与验证(填
search_verification 或放验证文件)、NEXT_PUBLIC_SITE_URL 指向正式域名。
2026-09-02 18:48:44 +08:00

133 lines
6.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import ScrambleReveal from "@/components/dom/ScrambleReveal";
import AboutMedia from "@/components/dom/AboutMedia";
import FooterSection from "@/components/dom/FooterSection";
import WorkSection from "@/components/dom/WorkSection";
import HyperSpaceSection from "@/components/dom/HyperSpaceSection";
import PasscodeRevealText from "@/components/dom/PasscodeRevealText";
import { PersonJsonLd } from "@/components/dom/PersonJsonLd";
import { getSiteConfig, listWorks } from "@/lib/siteConfig";
import type { WorkItem } from "@/lib/workItems";
/**
* 首页 — 结构复刻原站(haoqi_body.html),文案全部来自 site_config
*(/virtheart 后台「配置」可改,保存即生效);作品来自 works 表。
*/
export default async function Home() {
const config = getSiteConfig();
const items: WorkItem[] = listWorks(true)
.filter((w) => w.name && (w.image_url || w.href))
.map((w) => ({
name: w.name,
imageUrl: w.image_url,
hoverImageUrl: w.hover_image_url,
href: w.href || `/work/${w.slug}`,
year: w.year,
type: w.type,
gridClass: w.grid_class || "col-span-12 lg:col-span-6 xl:col-span-4",
codingProject: w.coding_project === 1,
passcodeProtected: w.passcode_protected === 1,
}));
return (
// NOTE: the original scrolls INSIDE <main> (its Lenis wraps the main
// container), which is what lets its position:sticky children pin. Our
// Lenis is window-level, so main must NOT be a scroll container —
// otherwise sticky (hyper-space section) never pins.
<main className="w-full">
{/* 结构化数据:个人实体(SEO 富结果) */}
<PersonJsonLd />
<div>
{/* Banner Section */}
<div
data-section="banner"
className="grid grid-cols-12 grid-rows-[auto_1fr] px-4 lg:px-14 py-18 lg:py-24 w-full h-dvh lg:h-screen"
>
<div className="flex flex-col order-2 lg:order-1 lg:grid lg:grid-cols-12 col-span-12 font-mono text-base">
<span className="hidden lg:block lg:col-span-3 xl:col-span-2 lg:col-start-1 xl:col-start-1 p-2 font-sans font-medium text-[4svw] sm:text-2xl lg:text-3xl leading-tight">
<ScrambleReveal text={config.hero_line1} startDelayMs={300} letterDelayMs={10} />
<br />
<ScrambleReveal text={config.hero_line2} startDelayMs={300} letterDelayMs={10} />
</span>
<ScrambleReveal
className="hidden lg:block lg:col-span-3 xl:col-span-2 lg:col-start-4 xl:col-start-5 p-2 text-balance"
text={config.hero_tagline}
startDelayMs={300}
letterDelayMs={10}
/>
<PasscodeRevealText
className="col-span-12 lg:col-span-6 xl:col-span-4 lg:col-start-7 xl:col-start-9 mt-auto lg:mt-0 p-2"
prefix={config.intro_prefix}
suffix={config.intro_suffix}
brandName={config.brand_name}
/>
</div>
<div
className="flex flex-col self-end order-1 lg:order-2 col-span-12 px-2 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] uppercase leading-none"
style={{ fontVariationSettings: '"wdth" 120' }}
>
<ScrambleReveal text={config.hero_big_1} startDelayMs={300} />
<ScrambleReveal text={config.hero_big_2} startDelayMs={500} />
<ScrambleReveal text={config.hero_big_3} startDelayMs={700} />
</div>
</div>
{/* Signature / About Section */}
<div className="grid grid-cols-12 px-4 lg:px-14 py-18 lg:py-24 lg:pb-28 w-full">
<AboutMedia />
<div className="flex flex-col justify-start items-start gap-6 col-span-12 sm:col-span-7 lg:col-span-8 sm:col-start-6 lg:col-start-5 text-base lg:text-xl leading-none">
<p
className="p-2 w-full text-l1 md:text-[4.2svw] text-xl leading-[1.3] md:leading-none select-text"
style={{
fontFamily:
'var(--font-tiktok), "MiSans", sans-serif',
}}
>
<span className="select-text">{config.about_p1}</span>
</p>
<p
className="p-2 w-full text-l2 md:text-[4.2svw] text-xl leading-[1.3] md:leading-none select-text"
style={{
fontFamily:
'var(--font-tiktok), "MiSans", sans-serif',
}}
>
<span className="select-text">
{config.about_p2}
<a
href={config.about_p2_link_href || "#selected-work"}
className="inline text-l1 underline underline-offset-[0.08em] decoration-solid decoration-(--label-3) transition-[text-decoration-color] duration-150 ease-out lg:[@media(hover:hover)]:hover:decoration-(--label-1)"
>
{config.about_p2_link_label}
</a>
{config.about_p2.endsWith(";") || config.about_p2.endsWith(",")
? "里记录了这些探索的痕迹。"
: ""}
</span>
</p>
</div>
</div>
{/* Selected Work grid (id="selected-work", WebGL image layers) */}
<WorkSection
items={items}
emptyText={{
headline: config.work_empty_headline,
note: config.work_empty_note,
ctaPrefix: config.work_empty_cta_prefix,
ctaSuffix: config.work_empty_cta_suffix,
ctaAction: config.work_empty_cta_action,
}}
contactEmail={config.contact_email}
/>
{/* Hyper-space scroll section (id="hyper-space"): the WebGL
hyperspace arrow (cursor.glb stripes) tracks this section's
screen rect and engulfs the viewport mid-scroll. */}
<HyperSpaceSection />
{/* Contact / Footer Section (#contact, data-section="footer") */}
<FooterSection contactEmail={config.contact_email} icpBeian={config.icp_beian} />
</div>
</main>
);
}