feat: make tryIt presets, limits, badges and buttons completely dynamic from JSON configs
This commit is contained in:
+2
-1
@@ -3,7 +3,8 @@ import { getEndpointById } from '@/lib/catalog/loader';
|
||||
import { SectionRenderer } from '@/components/sections/SectionRenderer';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
export const revalidate = 600; // ISR 10 minutes fallback per PRD §4.2
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const revalidate = 0;
|
||||
|
||||
export default function HomePage() {
|
||||
const page = getPageConfig('home');
|
||||
|
||||
@@ -9,6 +9,9 @@ interface ToolPageProps {
|
||||
params: { slug: string };
|
||||
}
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const revalidate = 0;
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tools = getAllTools();
|
||||
return tools.map((t) => ({ slug: t.slug }));
|
||||
@@ -21,22 +24,23 @@ export async function generateMetadata({ params }: ToolPageProps): Promise<Metad
|
||||
const name = resolveLocalised(tool.name, 'en');
|
||||
const summary = resolveLocalised(tool.summary, 'en');
|
||||
const exampleImg = tool.content?.examples?.[0]?.after || '/brand/og-default.png';
|
||||
const cleanTitle = (tool.seo?.title || `${name} Free Online`).replace(/ \| CRE Innovations$/, '');
|
||||
|
||||
return {
|
||||
title: tool.seo?.title || `${name} Free Online | CRE Innovations`,
|
||||
title: cleanTitle,
|
||||
description: tool.seo?.description || summary,
|
||||
alternates: {
|
||||
canonical: `/tools/${tool.slug}`,
|
||||
},
|
||||
openGraph: {
|
||||
title: `${name} Free Online | CRE Innovations`,
|
||||
title: `${cleanTitle} | CRE Innovations`,
|
||||
description: summary,
|
||||
type: 'website',
|
||||
images: [{ url: exampleImg, width: 800, height: 600, alt: name }],
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: `${name} Free Online | CRE Innovations`,
|
||||
title: `${cleanTitle} | CRE Innovations`,
|
||||
description: summary,
|
||||
images: [exampleImg],
|
||||
},
|
||||
|
||||
@@ -3,6 +3,9 @@ import { getPageConfig, getAllTools, getAllApps, getAllCategories } from '@/lib/
|
||||
import { SectionRenderer } from '@/components/sections/SectionRenderer';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
export const revalidate = 0;
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'All AI Photo Tools | Free Online Directory',
|
||||
description: 'Browse all free online AI photo editing tools: blemish remover, background cutout, photo enhancer, old photo restorer, and anime avatars.',
|
||||
|
||||
Reference in New Issue
Block a user