Spaces:
Configuration error
Configuration error
feat: add RelatedPrompts to prompt detail page for better internal linking
Browse files- src/app/p/[slug]/page.tsx +10 -2
src/app/p/[slug]/page.tsx
CHANGED
|
@@ -3,12 +3,13 @@ import { Metadata } from "next"
|
|
| 3 |
import prisma from "@/lib/prisma"
|
| 4 |
import { PromptRunner } from "@/components/prompt-runner"
|
| 5 |
import { ForkedPromptsDisplay } from "@/components/prompts/forked-prompts-display"
|
|
|
|
| 6 |
import { PromptSchema } from "@/types/prompt"
|
| 7 |
import { generateSEO, generatePromptSchema, generateBreadcrumbSchema, generateOGImageUrl } from "@/lib/seo"
|
| 8 |
|
| 9 |
const BASE_URL = process.env.NEXT_PUBLIC_APP_URL || 'https://open-prompt.netlify.app'
|
| 10 |
|
| 11 |
-
// Force dynamic rendering
|
| 12 |
export const dynamic = 'force-dynamic'
|
| 13 |
|
| 14 |
interface PromptPageProps {
|
|
@@ -150,8 +151,15 @@ export default async function PromptPage({ params }: PromptPageProps) {
|
|
| 150 |
parentSlug={prompt.parent?.slug}
|
| 151 |
/>
|
| 152 |
|
| 153 |
-
{/* Display forked/remixed prompts
|
| 154 |
<ForkedPromptsDisplay promptSlug={slug} />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
</div>
|
| 156 |
)
|
| 157 |
}
|
|
|
|
| 3 |
import prisma from "@/lib/prisma"
|
| 4 |
import { PromptRunner } from "@/components/prompt-runner"
|
| 5 |
import { ForkedPromptsDisplay } from "@/components/prompts/forked-prompts-display"
|
| 6 |
+
import { RelatedPrompts } from "@/components/prompts/related-prompts"
|
| 7 |
import { PromptSchema } from "@/types/prompt"
|
| 8 |
import { generateSEO, generatePromptSchema, generateBreadcrumbSchema, generateOGImageUrl } from "@/lib/seo"
|
| 9 |
|
| 10 |
const BASE_URL = process.env.NEXT_PUBLIC_APP_URL || 'https://open-prompt.netlify.app'
|
| 11 |
|
| 12 |
+
// Force dynamic rendering for individual prompt pages
|
| 13 |
export const dynamic = 'force-dynamic'
|
| 14 |
|
| 15 |
interface PromptPageProps {
|
|
|
|
| 151 |
parentSlug={prompt.parent?.slug}
|
| 152 |
/>
|
| 153 |
|
| 154 |
+
{/* Display forked/remixed prompts */}
|
| 155 |
<ForkedPromptsDisplay promptSlug={slug} />
|
| 156 |
+
|
| 157 |
+
{/* Related prompts for internal linking (SEO + engagement) */}
|
| 158 |
+
<RelatedPrompts
|
| 159 |
+
currentSlug={slug}
|
| 160 |
+
category={prompt.category}
|
| 161 |
+
tags={prompt.tags}
|
| 162 |
+
/>
|
| 163 |
</div>
|
| 164 |
)
|
| 165 |
}
|