Skip to content

feat(docs): improve SEO metadata, structured data, and crawlability#615

Open
zahlekhan wants to merge 1 commit into
mainfrom
posthog-code/seo-improvements
Open

feat(docs): improve SEO metadata, structured data, and crawlability#615
zahlekhan wants to merge 1 commit into
mainfrom
posthog-code/seo-improvements

Conversation

@zahlekhan

Copy link
Copy Markdown
Contributor

Why

Organic search is the docs site's #2 traffic channel and growing fast — Google referrals went ~3.5k → 40k pageviews/mo (Mar→May, PostHog project 79652), roughly 10×. Several gaps were leaking that growth. This PR is a comprehensive but low-risk metadata / structured-data pass, all confined to the docs/ app.

Changes

  • Sitemap (app/sitemap.ts): include /openclaw-os (a top-7 page with 17k views that was missing from the sitemap), use real blog publish dates for lastmod (was always "today"), and set monthly changefreq for blog posts.
  • Blog posts: dynamic per-post OG images via a new app/og/blog/[...slug]/route.tsx (mirrors the existing docs OG route + getBlogImage helper), plus full og:type=article / publishedTime / authors / Twitter card / canonical metadata (previously only title+description, so all posts shared the generic site image).
  • Docs pages (app/docs/[[...slug]]/page.tsx): explicit canonical, article OG, and Twitter card.
  • Playground (app/playground/layout.tsx): page-specific title/description/canonical — it was the Components by AD #2 page overall (46k views) but inherited the generic homepage title.
  • JSON-LD structured data: SoftwareApplication + Organization (home), BlogPosting + BreadcrumbList (blog), TechArticle + BreadcrumbList (docs), via a small shared components/seo/JsonLd.tsx.
  • PWA manifest + icons: app/manifest.ts plus real PNG icons (apple-touch-icon.png 180×180, icon-192/512.png, favicon-32.png) generated from favicon.svg.
  • Global (app/layout.tsx): @thesysdev Twitter handle, og:locale, PNG favicon fallback, and a themeColor viewport.

hreflang was intentionally skipped — the zh-CN translations aren't served as live routes yet, so it would point at nonexistent URLs.

Verification

  • pnpm build passes; new routes (/manifest.webmanifest, /og/blog/[...slug]) compile and prerender.
  • Confirmed in prerendered HTML: sitemap contains /openclaw-os and real blog lastmod; blog/docs/playground pages emit correct canonical + OG + Twitter tags; OG blog card renders (344KB webp); JSON-LD blocks present on home/blog/docs.
  • pnpm lint: no new errors introduced (pre-existing "setState within effect" errors only, in untouched interactive components).

Suggested follow-up

  • Re-submit the sitemap in Google Search Console after deploy and watch /openclaw-os impressions + the organic trend in PostHog.

Created with PostHog Code

Organic search is the docs site's #2 traffic channel and growing fast, but
several gaps were leaking that growth. This adds:

- Sitemap: include /openclaw-os (a top page that was missing), use real blog
  publish dates for lastmod, and set monthly changefreq for blog posts
- Blog posts: dynamic per-post OG images (mirrors the existing docs OG route),
  plus full og:type=article / Twitter card / canonical metadata
- Docs pages: explicit canonical, article OG, and Twitter card
- Playground: page-specific title/description/canonical (was inheriting the
  generic homepage title)
- JSON-LD: SoftwareApplication + Organization (home), BlogPosting + breadcrumbs
  (blog), TechArticle + breadcrumbs (docs)
- PWA manifest and proper PNG icons (apple-touch-icon, 192/512, favicon-32)
- Global: @thesysdev Twitter handle, og:locale, themeColor viewport

Generated-By: PostHog Code
Task-Id: 134200f7-d774-431c-b7b4-ff6281467d1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant