Skip to content

Commit 04cd074

Browse files
committed
Add search indexing metadata and sitemap entry
1 parent eb17419 commit 04cd074

5 files changed

Lines changed: 61 additions & 0 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "2.0.0",
44
"private": true,
55
"type": "module",
6+
"engines": {
7+
"node": ">=24 <25"
8+
},
69
"scripts": {
710
"dev": "astro dev",
811
"build": "astro build",

public/robots.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://tzheng.dev/sitemap.xml
5+
Sitemap: https://tzheng.dev/sitemap-index.xml

src/pages/index.astro

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,43 @@ const systemEntry = `
4545
4646
let html = readFileSync(sourcePath, "utf8")
4747
.replace(/<link rel="icon"[^>]+>/, '<link rel="icon" href="/favicon.png" type="image/png">\n <link rel="apple-touch-icon" href="/apple-touch-icon.png">')
48+
.replace(
49+
"<title>Haitao Zheng | Cyber Security</title>",
50+
`<title>Haitao Zheng | Cyber Security Portfolio</title>
51+
<meta name="description" content="Haitao Zheng, also known as Tao, Jensen Zheng, and Jensen Zane, is a Cyber Security & Privacy student building security tooling, cloud log analysis projects, IOC workflows, technical articles, and static-first web systems.">
52+
<meta name="keywords" content="Haitao Zheng, Tao Zheng, Tao, Jensen Zheng, Jensen Zane, jensenzheng, jensenzane, cyber security, cybersecurity portfolio, cloud security, blue team, IOC toolkit, security tooling, technical articles, developer portfolio, Astro portfolio, Cloudflare Pages">
53+
<link rel="canonical" href="https://tzheng.dev/">
54+
<meta property="og:title" content="Haitao Zheng | Cyber Security Portfolio">
55+
<meta property="og:description" content="Cyber security portfolio, technical articles, project case studies, and system design notes by Haitao Zheng.">
56+
<meta property="og:type" content="website">
57+
<meta property="og:url" content="https://tzheng.dev/">
58+
<meta property="og:image" content="https://tzheng.dev/logo.png">
59+
<meta name="twitter:card" content="summary_large_image">
60+
<script type="application/ld+json">
61+
{
62+
"@context": "https://schema.org",
63+
"@graph": [
64+
{
65+
"@type": "Person",
66+
"@id": "https://tzheng.dev/#person",
67+
"name": "Haitao Zheng",
68+
"alternateName": ["Tao", "Tao Zheng", "Jensen Zheng", "Jensen Zane", "jensenzheng", "jensenzane"],
69+
"url": "https://tzheng.dev/",
70+
"sameAs": ["https://github.com/0xTaoZ"],
71+
"knowsAbout": ["Cyber Security", "Cloud Security", "Blue Team", "IOC Workflows", "Security Tooling", "Static Websites", "Astro", "Cloudflare Pages"]
72+
},
73+
{
74+
"@type": "WebSite",
75+
"@id": "https://tzheng.dev/#website",
76+
"url": "https://tzheng.dev/",
77+
"name": "Haitao Zheng | Cyber Security Portfolio",
78+
"alternateName": ["tzheng.dev", "Tao Zheng Portfolio", "Jensen Zheng Cyber Security Portfolio"],
79+
"description": "Personal cyber security portfolio, technical articles, project case studies, and system design notes by Haitao Zheng."
80+
}
81+
]
82+
}
83+
</script>`
84+
)
4885
.replace(
4986
'<a href="#" class="text-white tracking-widest font-semibold hover:opacity-70 transition duration-300 flex items-center gap-3"><span class="nav-dot"></span>HAITAO ZHENG</a>',
5087
'<a href="#" class="text-white hover:opacity-80 transition duration-300 flex items-center" aria-label="Haitao Zheng home"><img src="/logo.png" alt="" class="w-8 h-8 rounded-xl object-cover border border-white/10 shadow-[0_0_24px_rgba(125,211,252,0.22)]"></a>'

src/pages/sitemap.xml.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export async function GET() {
2+
return new Response(
3+
`<?xml version="1.0" encoding="UTF-8"?>
4+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
5+
<sitemap>
6+
<loc>https://tzheng.dev/sitemap-0.xml</loc>
7+
</sitemap>
8+
</sitemapindex>`,
9+
{
10+
headers: {
11+
"Content-Type": "application/xml; charset=utf-8"
12+
}
13+
}
14+
);
15+
}

0 commit comments

Comments
 (0)