feat : 6 astra improve it
This commit is contained in:
@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";
|
||||
|
||||
import { GoogleAdsense } from "@/components/public/google-adsense";
|
||||
import { publicSections, StructuredGuideShell } from "@/components/public/structured-guide";
|
||||
import { getCachedPublicGuide } from "@/lib/cache/public";
|
||||
import { getCachedPublicGuide, getCachedPublicGuideSummary } from "@/lib/cache/public";
|
||||
|
||||
type Params = Promise<{ character: string; page: string }>;
|
||||
|
||||
@@ -11,7 +11,7 @@ export const instant = false;
|
||||
|
||||
export async function generateMetadata({ params }: { params: Params }): Promise<Metadata> {
|
||||
const { character } = await params;
|
||||
const guide = await getCachedPublicGuide(character);
|
||||
const guide = await getCachedPublicGuideSummary(character);
|
||||
return guide
|
||||
? {
|
||||
title: `${guide.name}`,
|
||||
@@ -24,7 +24,7 @@ export async function generateMetadata({ params }: { params: Params }): Promise<
|
||||
|
||||
export default async function GuideSectionPage({ params }: { params: Params }) {
|
||||
const { character, page } = await params;
|
||||
const guide = await getCachedPublicGuide(character);
|
||||
const guide = await getCachedPublicGuide(character, page);
|
||||
if (!guide || !publicSections(guide).some((section) => section.slug === page)) notFound();
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";
|
||||
|
||||
import { GoogleAdsense } from "@/components/public/google-adsense";
|
||||
import { StructuredGuideShell } from "@/components/public/structured-guide";
|
||||
import { getCachedPublicGuide } from "@/lib/cache/public";
|
||||
import { getCachedPublicGuide, getCachedPublicGuideSummary } from "@/lib/cache/public";
|
||||
|
||||
type Params = Promise<{ character: string }>;
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function generateMetadata({
|
||||
}: {
|
||||
params: Params;
|
||||
}): Promise<Metadata> {
|
||||
const guide = await getCachedPublicGuide((await params).character);
|
||||
const guide = await getCachedPublicGuideSummary((await params).character);
|
||||
return guide
|
||||
? {
|
||||
title: `${guide.name}`,
|
||||
|
||||
Reference in New Issue
Block a user