File tree Expand file tree Collapse file tree 5 files changed +17
-6
lines changed
app/[platform]/[category]/[pattern]/[quality]/[id] Expand file tree Collapse file tree 5 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ export default async function PatternDetailPage({ params }: PageProps) {
233233 < a
234234 href = { entry . source . url }
235235 target = "_blank"
236- rel = "noopener noreferrer"
236+ rel = "noopener noreferrer nofollow "
237237 className = "inline-flex items-center gap-2 px-4 py-2 bg-fd-primary text-fd-primary-foreground rounded-lg hover:bg-fd-primary/90 transition-colors ml-auto"
238238 >
239239 < span > View on { entry . website } </ span >
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export function Header() {
6464 key = { social . label }
6565 href = { social . link }
6666 target = "_blank"
67- rel = "noopener noreferrer"
67+ rel = "noopener noreferrer nofollow "
6868 className = { `text-fd-muted-foreground hover:text-fd-foreground transition-colors ${ TRACKING_CLASSES . FOOTER_SOCIAL_CLICK } ` }
6969 >
7070 { social . icon }
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export function EntryModal({
9292 < a
9393 href = { `https://${ entry . website } ` }
9494 target = "_blank"
95- rel = "noopener noreferrer"
95+ rel = "noopener noreferrer nofollow "
9696 className = "inline-block hover:opacity-80 transition-opacity"
9797 >
9898 < WebsitePill
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export const Stars = ({
4545 < a
4646 href = "https://github.com/thedaviddias/ux-patterns-for-developers"
4747 target = "_blank"
48- rel = "noopener noreferrer"
48+ rel = "noopener noreferrer nofollow "
4949 onClick = { ( ) => plausible ( GALLERY_TRACKING_EVENTS . GITHUB_STAR_CLICK ) }
5050 className = { className }
5151 aria-label = "Star on GitHub"
Original file line number Diff line number Diff line change @@ -17,9 +17,20 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
1717 ) ;
1818 }
1919
20- // Default link behavior
20+ // Check if it's an external link (not your own domains)
21+ const isExternal =
22+ href &&
23+ typeof href === "string" &&
24+ ( href . startsWith ( "http://" ) || href . startsWith ( "https://" ) ) &&
25+ ! href . includes ( "uxpatterns.dev" ) &&
26+ ! href . includes ( "kit.uxpatterns.dev" ) &&
27+ ! href . includes ( "thedaviddias.com" ) ;
28+
29+ // Add nofollow to external links
30+ const rel = isExternal ? "nofollow" : undefined ;
31+
2132 return (
22- < a href = { href } { ...props } >
33+ < a href = { href } rel = { rel } { ...props } >
2334 { children }
2435 </ a >
2536 ) ;
You can’t perform that action at this time.
0 commit comments