Skip to content

feat: add SEO metadata and structured data - #81

Open
VitorBernalRodrigues wants to merge 1 commit into
FinesseStudioLab:mainfrom
VitorBernalRodrigues:chore/seo-metadata
Open

feat: add SEO metadata and structured data#81
VitorBernalRodrigues wants to merge 1 commit into
FinesseStudioLab:mainfrom
VitorBernalRodrigues:chore/seo-metadata

Conversation

@VitorBernalRodrigues

Copy link
Copy Markdown

Summary

Adds the SEO metadata infrastructure requested in #66.

  • Adds generated sitemap.xml using the shared site map data.
  • Adds robots.txt with production and preview-specific indexing behavior.
  • Blocks Vercel preview deployments from being indexed.
  • Adds Organization and SoftwareApplication JSON-LD structured data.
  • Adds route-specific descriptions for all public pages.
  • Extracts the public route definitions into a shared module used by both the site map UI and metadata routes.
  • Adds focused SEO tests without introducing new dependencies.

Implementation

The public route list is now shared through lib/site-map.ts, avoiding a duplicated route inventory between the UI and sitemap generation.

Canonical URLs are resolved from:

  1. VERCEL_PROJECT_PRODUCTION_URL
  2. VERCEL_URL
  3. http://localhost:3000 for local development

Preview deployments are detected through VERCEL_ENV === "preview" and return:

  • Disallow: / from robots.txt
  • noindex, nofollow HTML metadata

Production and local development remain indexable.

Structured data is rendered server-side and includes:

  • Organization
  • SoftwareApplication

The JSON-LD serialization escapes < to avoid prematurely terminating the script element.

Testing

Passed locally:

  • npm run test:seo — 6/6 tests
  • npm run lint
  • npx tsc --noEmit
  • npm run build
  • git diff --check

The production build generated both /robots.txt and /sitemap.xml.

The generated sitemap, robots metadata, structured data, and route metadata were also verified with a local production server.

Notes

No new dependencies were added and there are no visual changes.

Closes #66

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.

ops: add sitemap.xml, robots.txt, and structured data

1 participant