fix: 修复6个use client页面metadata冲突,创建layout.tsx承载metadata
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "追光AI日报 - AI行业前沿资讯",
|
||||
description: "每日精选AI行业新闻,涵盖模型前沿、产品落地、开源生态、商业产业、政策治理等板块。",
|
||||
};
|
||||
|
||||
export default function DailyLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import Link from "next/link";
|
||||
import { HeroBanner } from "@/components/common/HeroBanner";
|
||||
@@ -47,11 +46,6 @@ const CATEGORIES: Record<string, { label: string; color: string; bg: string; ico
|
||||
const CATEGORY_KEYS = Object.keys(CATEGORIES);
|
||||
const PAGE_SIZE = 15;
|
||||
|
||||
export const metadata = {
|
||||
title: "追光AI日报 - AI行业前沿资讯",
|
||||
description: "每日精选AI行业新闻,涵盖模型前沿、产品落地、开源生态、商业产业、政策治理等板块。",
|
||||
};
|
||||
|
||||
export default function DailyPage() {
|
||||
const [allItems, setAllItems] = useState<FlatItem[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "登录 - 追光AI",
|
||||
description: "登录追光AI,管理你的AI工具收藏与技能评测。",
|
||||
};
|
||||
|
||||
export default function LoginLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,15 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { signIn } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { LoginForm } from "@/components/common/LoginForm";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "登录 - 追光AI",
|
||||
description: "登录追光AI,管理你的AI工具收藏与技能评测。",
|
||||
};
|
||||
|
||||
export default function LoginPage() {
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "追光评测 - AI技能深度评测",
|
||||
description: "五维AI技能评测体系,客观评价开源AI项目的功能性、易用性、文档质量、性能和社区活跃度。",
|
||||
};
|
||||
|
||||
export default function ReviewsLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { useState, useEffect } from "react";
|
||||
import { HeroBanner } from "@/components/common/HeroBanner";
|
||||
import { ReviewsList } from "./ReviewsList";
|
||||
@@ -22,11 +21,6 @@ interface RankingsData {
|
||||
totalReviews: number;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "追光评测 - AI技能深度评测",
|
||||
description: "五维AI技能评测体系,客观评价开源AI项目的功能性、易用性、文档质量、性能和社区活跃度。",
|
||||
};
|
||||
|
||||
export default function ReviewsPage() {
|
||||
const [rankings, setRankings] = useState<RankingsData | null>(null);
|
||||
const [totalReviews, setTotalReviews] = useState(0);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "我的收藏夹 - 追光AI",
|
||||
};
|
||||
|
||||
export default function CollectionsLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -15,10 +14,6 @@ interface Collection {
|
||||
_count: { items: number };
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "我的收藏夹 - 追光AI",
|
||||
};
|
||||
|
||||
export default function CollectionsPage() {
|
||||
const { data: session, status } = useSession();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "我的收藏 - 追光AI",
|
||||
};
|
||||
|
||||
export default function FavoritesLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -51,10 +50,6 @@ const sourceTypeColor: Record<string, string> = {
|
||||
|
||||
type FilterType = "all" | "tool" | "skill";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "我的收藏 - 追光AI",
|
||||
};
|
||||
|
||||
export default function FavoritesPage() {
|
||||
const { data: session, status } = useSession();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "个人中心 - 追光AI",
|
||||
description: "管理你的追光AI个人资料、收藏与成就。",
|
||||
};
|
||||
|
||||
export default function UserLayout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useSession, signOut } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -47,11 +46,6 @@ function getTimeAgo(date: Date | string): string {
|
||||
return d.toLocaleDateString("zh-CN");
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "个人中心 - 追光AI",
|
||||
description: "管理你的追光AI个人资料、收藏与成就。",
|
||||
};
|
||||
|
||||
export default function UserProfilePage() {
|
||||
const { data: session, status } = useSession();
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user