From cc6f812bf29624f809c8d4435d61710c6619cab9 Mon Sep 17 00:00:00 2001 From: Sarina Li Date: Wed, 29 Oct 2025 17:21:02 -0400 Subject: [PATCH] fix some metadata + add footer for seo --- docs/src/app/(home)/[[...slug]]/page.tsx | 86 +++++++++++- docs/src/app/layout.config.tsx | 9 +- docs/src/components/footer.tsx | 164 +++++++++++++++++++++-- 3 files changed, 244 insertions(+), 15 deletions(-) diff --git a/docs/src/app/(home)/[[...slug]]/page.tsx b/docs/src/app/(home)/[[...slug]]/page.tsx index dc283204..8aa89620 100644 --- a/docs/src/app/(home)/[[...slug]]/page.tsx +++ b/docs/src/app/(home)/[[...slug]]/page.tsx @@ -273,15 +273,99 @@ export async function generateMetadata(props: { if (page.url.includes('api')) title = `${page.data.title} | Cua API Docs`; if (page.url.includes('guide')) title = ` Guide: ${page.data.title} | Cua Docs`; + // Canonical URL points to cua.ai to consolidate all SEO authority on main domain + const canonicalUrl = `https://cua.ai${page.url}`; + + // Extract keywords from the page for SEO + const keywords = [ + 'computer use agent', + 'computer use', + 'AI automation', + 'visual automation', + page.data.title, + ]; + + // Structured data for better Google indexing (TechArticle schema) + const structuredData = { + '@context': 'https://schema.org', + '@type': 'TechArticle', + headline: page.data.title, + description: page.data.description, + url: canonicalUrl, + publisher: { + '@type': 'Organization', + name: 'Cua', + url: 'https://cua.ai', + logo: { + '@type': 'ImageObject', + url: 'https://cua.ai/cua_logo_black.svg', + }, + }, + mainEntityOfPage: { + '@type': 'WebPage', + '@id': canonicalUrl, + }, + }; + + // Breadcrumb schema for better site structure understanding + const breadcrumbSchema = { + '@context': 'https://schema.org', + '@type': 'BreadcrumbList', + itemListElement: [ + { + '@type': 'ListItem', + position: 1, + name: 'Cua', + item: 'https://cua.ai', + }, + { + '@type': 'ListItem', + position: 2, + name: 'Documentation', + item: 'https://cua.ai/docs', + }, + { + '@type': 'ListItem', + position: 3, + name: page.data.title, + item: canonicalUrl, + }, + ], + }; + return { title, description: page.data.description, + keywords, + authors: [{ name: 'Cua', url: 'https://cua.ai' }], + robots: { + index: true, + follow: true, + googleBot: { + index: true, + follow: true, + 'max-image-preview': 'large', + 'max-snippet': -1, + }, + }, + alternates: { + canonical: canonicalUrl, + }, openGraph: { title, description: page.data.description, type: 'article', siteName: 'Cua Docs', - url: 'https://trycua.com/docs', + url: canonicalUrl, + }, + twitter: { + card: 'summary', + title, + description: page.data.description, + creator: '@trycua', + }, + other: { + 'script:ld+json': JSON.stringify([structuredData, breadcrumbSchema]), }, }; } diff --git a/docs/src/app/layout.config.tsx b/docs/src/app/layout.config.tsx index d43acae6..87c652f1 100644 --- a/docs/src/app/layout.config.tsx +++ b/docs/src/app/layout.config.tsx @@ -41,15 +41,15 @@ export const baseOptions: BaseLayoutProps = { githubUrl: 'https://github.com/trycua/cua', links: [ { - url: 'https://trycua.com', - text: 'Cua home', + url: 'https://cua.ai', + text: 'Cua Home', type: 'icon', icon: , - external: false, + external: true, }, { url: 'https://discord.com/invite/mVnXXpdE85', - text: 'Cua discord', + text: 'Discord', type: 'icon', icon: ( <> @@ -69,6 +69,7 @@ export const baseOptions: BaseLayoutProps = { /> ), + external: true, }, ], }; diff --git a/docs/src/components/footer.tsx b/docs/src/components/footer.tsx index 2aafa33b..088a5938 100644 --- a/docs/src/components/footer.tsx +++ b/docs/src/components/footer.tsx @@ -1,15 +1,159 @@ export function Footer() { return ( -