From 95e4c3e9fbf6384ccc239fdf8caa4d179272757b Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 10 Feb 2025 22:35:33 -0500 Subject: [PATCH] fix: dupplicates seo --- app/[lang]/[[...mdxPath]]/page.tsx | 18 ++++++++++++++---- content/en/glossary/pagination.mdx | 2 +- content/en/patterns/getting-started.mdx | 4 ++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/[lang]/[[...mdxPath]]/page.tsx b/app/[lang]/[[...mdxPath]]/page.tsx index bb95023..18b7d97 100755 --- a/app/[lang]/[[...mdxPath]]/page.tsx +++ b/app/[lang]/[[...mdxPath]]/page.tsx @@ -19,18 +19,28 @@ export async function generateMetadata({ params }): Promise { const description = frontMatter?.description || metadata?.description || '' const summary = frontMatter?.summary || '' - // OG image handling + // Page type detection const isPatternPage = params.mdxPath?.[0] === 'patterns' + const isGlossaryPage = params.mdxPath?.[0] === 'glossary' + + // Title with context + const titleWithContext = isPatternPage + ? `${title} Pattern` + : isGlossaryPage + ? `${title} - UX Glossary Term` + : title + + // OG image handling const patternName = isPatternPage ? params.mdxPath?.[params.mdxPath.length - 1] : null const ogImageUrl = isHomepage ? '/og/opengraph-image.png' - : `/api/og?title=${encodeURIComponent(title)}` + : `/api/og?title=${encodeURIComponent(titleWithContext)}` return { - title, + title: titleWithContext, description, openGraph: { - title, + title: titleWithContext, description, type: isHomepage ? 'website' : 'article', images: isPatternPage && patternName ? [{ diff --git a/content/en/glossary/pagination.mdx b/content/en/glossary/pagination.mdx index 9913034..381e00a 100644 --- a/content/en/glossary/pagination.mdx +++ b/content/en/glossary/pagination.mdx @@ -16,7 +16,7 @@ import { GlossaryStructuredData } from "@app/_components/glossary/structured-dat category={["Pattern", "Navigation"]} /> -# Pagination +# Pagination in UX Design Pagination is a fundamental user interface pattern that divides large sets of content into smaller, more manageable chunks called "pages". This pattern helps users navigate through extensive collections of data, such as search results, product listings, or blog posts. diff --git a/content/en/patterns/getting-started.mdx b/content/en/patterns/getting-started.mdx index 818b768..900770f 100755 --- a/content/en/patterns/getting-started.mdx +++ b/content/en/patterns/getting-started.mdx @@ -1,3 +1,7 @@ +--- +description: UX Patterns for Devs is a comprehensive resource that helps developers implement effective, accessible, and usable UI components +--- + import { Link } from "nextra-theme-docs"; import { Callout, FileTree, Steps } from "nextra/components";