Skip to content

Commit 95e4c3e

Browse files
committed
fix: dupplicates seo
1 parent 604f2a5 commit 95e4c3e

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

app/[lang]/[[...mdxPath]]/page.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,28 @@ export async function generateMetadata({ params }): Promise<Metadata> {
1919
const description = frontMatter?.description || metadata?.description || ''
2020
const summary = frontMatter?.summary || ''
2121

22-
// OG image handling
22+
// Page type detection
2323
const isPatternPage = params.mdxPath?.[0] === 'patterns'
24+
const isGlossaryPage = params.mdxPath?.[0] === 'glossary'
25+
26+
// Title with context
27+
const titleWithContext = isPatternPage
28+
? `${title} Pattern`
29+
: isGlossaryPage
30+
? `${title} - UX Glossary Term`
31+
: title
32+
33+
// OG image handling
2434
const patternName = isPatternPage ? params.mdxPath?.[params.mdxPath.length - 1] : null
2535
const ogImageUrl = isHomepage
2636
? '/og/opengraph-image.png'
27-
: `/api/og?title=${encodeURIComponent(title)}`
37+
: `/api/og?title=${encodeURIComponent(titleWithContext)}`
2838

2939
return {
30-
title,
40+
title: titleWithContext,
3141
description,
3242
openGraph: {
33-
title,
43+
title: titleWithContext,
3444
description,
3545
type: isHomepage ? 'website' : 'article',
3646
images: isPatternPage && patternName ? [{

content/en/glossary/pagination.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { GlossaryStructuredData } from "@app/_components/glossary/structured-dat
1616
category={["Pattern", "Navigation"]}
1717
/>
1818

19-
# Pagination
19+
# Pagination in UX Design
2020

2121
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.
2222

content/en/patterns/getting-started.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: UX Patterns for Devs is a comprehensive resource that helps developers implement effective, accessible, and usable UI components
3+
---
4+
15
import { Link } from "nextra-theme-docs";
26
import { Callout, FileTree, Steps } from "nextra/components";
37

0 commit comments

Comments
 (0)