feat: prerender per-component pages for SEO (vite-ssg) - #2
Merged
Conversation
The site was a client-rendered SPA: crawlers and AI bots that don't run JS saw an empty <div id="app"> — every good meta tag wrapped no body. This adds static prerendering and one indexable page per component, turning a single URL into 16. - Adopt vite-ssg + vue-router; prerender / and /components/<slug> to real HTML with per-route <head> (title, description, canonical, OG, BreadcrumbList + SoftwareSourceCode JSON-LD) via unhead - Add a component catalog as the single source of truth for the gallery, the detail pages, the CLI install picker and the sitemap - Split App.vue into a layout (header/footer/theme) + Home and ComponentDetail views; cards deep-link to their pages for internal linking; live demos stay client-only so prerendered HTML is text - Generate sitemap.xml from the registry at build (home + every page) - Switch Tailwind v4 to its official Vite plugin so CSS resolves in the SSR build; move overridable head tags out of index.html to avoid duplicate tags Home body and all component prose now render server-side; verified no hydration warnings and no duplicate meta tags.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Swap arbitrary values for their v4 shorthand tokens across the components and site: - opacity modifiers: /[0.04] -> /4, /[0.06] -> /6, /[0.07] -> /7, /[0.10] -> /10, /[0.02] -> /2 - transition duration: duration-[400ms] -> duration-400 - CSS variable: max-h-[var(--h)] -> max-h-(--h) Compiled CSS is byte-for-byte equivalent (verified max-height:var(--h) and .duration-400 in the build output); this only clears the editor "can be written as" hints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1 (targets
feat/input-components-and-ci; GitHub will retarget tomainonce #1 merges).Why
The SEO audit found the decisive issue: the site was a client-rendered SPA, so crawlers and AI bots that don't run JS saw an empty
<div id="app">— ~8 words, zero headings. Every strong meta tag wrapped an empty body, and the sitemap held a single URL.What
vite-ssg+vue-router—/and/components/<slug>build to real static HTML. 16 pages now, up from 1.<head>withunhead: unique title, description, canonical, OG/Twitter, plusBreadcrumbList+SoftwareSourceCodeJSON-LD per component.src/catalog.ts) — single source of truth for the gallery, detail pages, CLI install picker (was stale, missing the 4 new components), and the sitemap.App.vuebecomes header/footer/theme shell;Home.vue+ComponentDetail.vueare views. Gallery cards deep-link to detail pages (internal linking). Live demos are client-only so prerendered HTML stays text.index.htmlto avoid duplicate tags.Verification
og:typecorrectly overrides toarticle, install picker preselects, demos + theme intact.type-check,lint:check,format:check,buildall green.SEO impact
Directly resolves the audit's Critical (empty shell → real content for non-JS bots incl. AI crawlers) and High (1 URL → 16, long-tail keywords per component) findings.