Consolidate site metadata and add metadata preview tests#29
Conversation
- Move root head metadata into a shared helper - Pin the canonical OG image URL and verify Twitter cards
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@greptile review |
Greptile SummaryThis PR consolidates the fumadocs root-route metadata into a shared
Confidence Score: 5/5Safe to merge — the change is a clean consolidation that removes duplicate conflicting meta tags and adds build-time cache-busting with no risky side effects. The refactoring eliminates genuine duplicate/conflicting OG and Twitter tags from the old root route, introduces well-typed shared metadata, and adds meaningful test coverage. The cache-busting mechanism correctly derives the version from the git SHA at build time with a sensible date fallback, so the "dev" string only appears in local Bun test runs where Vite's define is not active. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
ENV["Environment\nVITE_OG_IMAGE_VERSION\nVERCEL_GIT_COMMIT_SHA"]
VITE["vite.config.ts\nloadEnv → ogImageVersion\n(git SHA | date fallback)"]
DEFINE["Vite define\nimport.meta.env.VITE_OG_IMAGE_VERSION"]
SHARED["shared.ts\nsiteUrl · siteOgImagePath\nsiteOgImageVersion · siteOgImageUrl"]
META["metadata.ts\nsiteMeta: MetaDescriptor[]"]
ROOT["__root.tsx\nhead() → { meta: siteMeta }"]
TEST["metadata.test.ts\nbun test"]
ENV --> VITE
VITE --> DEFINE
DEFINE --> SHARED
SHARED --> META
META --> ROOT
META --> TEST
SHARED --> TEST
Reviews (10): Last reviewed commit: "fix: address final Greptile metadata nit..." | Re-trigger Greptile |
Greptile SummaryThis PR extracts the fumadocs root route's inline head metadata into a shared
Confidence Score: 4/5Safe to merge; the core consolidation is correct and the duplicate-meta bug is properly resolved. The metadata extraction and duplicate-tag cleanup are straightforward and correct. The main concerns are quality-oriented: the test regex hardcodes the production domain, the cache-buster version is a static date that must be bumped by hand, and the custom HeadMeta type drifts from TanStack Router's own type. None of these affect the runtime behaviour of the site today. apps/fumadocs/src/lib/metadata.test.ts — the hardcoded domain in the regex is the most likely source of a future test failure worth addressing before it causes confusion in CI. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["shared.ts"] --> B["metadata.ts\n(siteMeta: HeadMeta[])"]
B --> C["__root.tsx\nhead() meta: siteMeta"]
B --> D["metadata.test.ts\nbun:test assertions"]
D --> E["og:image check"]
D --> F["twitter:card check"]
E --> G["regex: email-sdk.dev domain hardcoded"]
Reviews (2): Last reviewed commit: "Consolidate site metadata and add previe..." | Re-trigger Greptile |
|
@greptile review |
|
@greptile review |
|
@greptile review |
|
@greptile review |
Summary
siteMetamodule.bun:testchecks.apps/fumadocstest script for running the new metadata tests.Testing
bun testcoverage for the canonical OG/Twitter image URL andtwitter:cardpreview format.