diff --git a/src/app/[locale]/[...catchAll]/page.tsx b/src/app/[locale]/[...catchAll]/page.tsx
new file mode 100644
index 0000000..19fb7ca
--- /dev/null
+++ b/src/app/[locale]/[...catchAll]/page.tsx
@@ -0,0 +1,5 @@
+import { notFound } from 'next/navigation'
+
+export default function CatchAllPage() {
+ notFound()
+}
diff --git a/src/app/[locale]/not-found.tsx b/src/app/[locale]/not-found.tsx
new file mode 100644
index 0000000..a5a8881
--- /dev/null
+++ b/src/app/[locale]/not-found.tsx
@@ -0,0 +1,32 @@
+import Link from 'next/link'
+import { getTranslations } from 'next-intl/server'
+
+export default async function NotFound() {
+ const t = await getTranslations('notFound')
+
+ return (
+
+
404
+
+ {t('title')}
+
+
+ {t('description')}
+
+
+
+ {t('backHome')}
+
+
+ {t('browseProjects')}
+
+
+
+ )
+}
diff --git a/src/app/robots.ts b/src/app/robots.ts
new file mode 100644
index 0000000..e6c45f8
--- /dev/null
+++ b/src/app/robots.ts
@@ -0,0 +1,16 @@
+import { MetadataRoute } from 'next'
+
+export default function robots(): MetadataRoute.Robots {
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://agentpark.ai'
+
+ return {
+ rules: [
+ {
+ userAgent: '*',
+ allow: '/',
+ disallow: ['/api/', '/private/'],
+ },
+ ],
+ sitemap: `${baseUrl}/sitemap.xml`,
+ }
+}
diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts
new file mode 100644
index 0000000..caa12fa
--- /dev/null
+++ b/src/app/sitemap.ts
@@ -0,0 +1,55 @@
+import { MetadataRoute } from 'next'
+import { getProjects } from '@/hooks/useProjects'
+
+export default async function sitemap(): Promise {
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://agentpark.ai'
+
+ // 获取所有项目
+ const { projects } = await getProjects({ limit: 1000 })
+
+ // 静态页面
+ const staticPages: MetadataRoute.Sitemap = [
+ {
+ url: `${baseUrl}/zh`,
+ lastModified: new Date(),
+ changeFrequency: 'daily',
+ priority: 1,
+ },
+ {
+ url: `${baseUrl}/en`,
+ lastModified: new Date(),
+ changeFrequency: 'daily',
+ priority: 1,
+ },
+ {
+ url: `${baseUrl}/zh/projects`,
+ lastModified: new Date(),
+ changeFrequency: 'daily',
+ priority: 0.9,
+ },
+ {
+ url: `${baseUrl}/en/projects`,
+ lastModified: new Date(),
+ changeFrequency: 'daily',
+ priority: 0.9,
+ },
+ ]
+
+ // 项目详情页(中英文)
+ const projectPages: MetadataRoute.Sitemap = projects.flatMap((project) => [
+ {
+ url: `${baseUrl}/zh/projects/${project.slug}`,
+ lastModified: project.updatedAt,
+ changeFrequency: 'weekly' as const,
+ priority: 0.8,
+ },
+ {
+ url: `${baseUrl}/en/projects/${project.slug}`,
+ lastModified: project.updatedAt,
+ changeFrequency: 'weekly' as const,
+ priority: 0.8,
+ },
+ ])
+
+ return [...staticPages, ...projectPages]
+}
diff --git a/src/messages/en.json b/src/messages/en.json
index cca6d74..d5cf535 100644
--- a/src/messages/en.json
+++ b/src/messages/en.json
@@ -36,7 +36,31 @@
"browseByTagsSection": "BROWSE BY TAGS",
"featuredProjectsSection": "FEATURED PROJECTS",
"viewAll": "VIEW ALL",
- "viewAllProjects": "VIEW ALL PROJECTS"
+ "viewAllProjects": "VIEW ALL PROJECTS",
+ "insightsSection": "Site Overview",
+ "statsTotalProjects": "Total Projects",
+ "statsActiveProjects": "Active Projects",
+ "statsArchivedProjects": "Archived Projects",
+ "statsTotalTags": "Total Tags",
+ "statsNewProjects7d": "New in 7 Days",
+ "rankingsSection": "Project Rankings",
+ "latestRankingTitle": "Latest Additions",
+ "starsRankingTitle": "GitHub Stars Ranking",
+ "window24h": "24H",
+ "window7d": "7D",
+ "window30d": "30D",
+ "noLatestProjects": "No new projects in this time window",
+ "noStarsProjects": "No stars data available",
+ "viewAllLatest": "View all latest projects",
+ "viewAllByStars": "View all by stars",
+ "tagInsightsSection": "Tag Popularity & Distribution",
+ "topTagsTitle": "Top Tags",
+ "categoryDistributionTitle": "Category Distribution",
+ "tagsUnit": "tags",
+ "projectsUnit": "projects",
+ "noTagData": "No tag metrics available",
+ "recentTimelineSection": "Recent Additions Timeline",
+ "noTimelineProjects": "No recent additions yet"
},
"project": {
"backToProjects": "BACK TO PROJECTS",
@@ -104,6 +128,12 @@
"about": "About",
"submitProject": "SUBMIT PROJECT"
},
+ "notFound": {
+ "title": "Page Not Found",
+ "description": "Sorry, the page you're looking for doesn't exist or has been moved.",
+ "backHome": "Back to Home",
+ "browseProjects": "Browse Projects"
+ },
"layout": {
"announcement": "DISCOVER THE FUTURE OF AI AGENTS",
"announcementHref": "/projects",
diff --git a/src/messages/zh.json b/src/messages/zh.json
index 85473fc..70d9b3b 100644
--- a/src/messages/zh.json
+++ b/src/messages/zh.json
@@ -36,7 +36,31 @@
"browseByTagsSection": "按标签浏览",
"featuredProjectsSection": "精选项目",
"viewAll": "查看全部",
- "viewAllProjects": "查看全部项目"
+ "viewAllProjects": "查看全部项目",
+ "insightsSection": "站点概览",
+ "statsTotalProjects": "项目总数",
+ "statsActiveProjects": "活跃项目",
+ "statsArchivedProjects": "归档项目",
+ "statsTotalTags": "标签总数",
+ "statsNewProjects7d": "近7天新增",
+ "rankingsSection": "项目榜单",
+ "latestRankingTitle": "最新入库榜",
+ "starsRankingTitle": "GitHub Stars 榜",
+ "window24h": "24小时",
+ "window7d": "7天",
+ "window30d": "30天",
+ "noLatestProjects": "该时间窗口暂无新增项目",
+ "noStarsProjects": "暂无可展示的 Stars 数据",
+ "viewAllLatest": "查看全部最新项目",
+ "viewAllByStars": "查看全部 Stars 排序",
+ "tagInsightsSection": "标签热度与分布",
+ "topTagsTitle": "热门标签",
+ "categoryDistributionTitle": "分类分布",
+ "tagsUnit": "个标签",
+ "projectsUnit": "个项目",
+ "noTagData": "暂无标签统计数据",
+ "recentTimelineSection": "最近新增时间线",
+ "noTimelineProjects": "暂无最近新增项目"
},
"project": {
"backToProjects": "返回项目列表",
@@ -104,6 +128,12 @@
"about": "关于",
"submitProject": "提交项目"
},
+ "notFound": {
+ "title": "页面未找到",
+ "description": "抱歉,您访问的页面不存在或已被移除。",
+ "backHome": "返回首页",
+ "browseProjects": "浏览项目"
+ },
"layout": {
"announcement": "发现 AI 代理的未来",
"announcementHref": "/projects",