seo-meta-tags-spa
Skill10 starsChanged 6 months agoMITView on GitHub
Use when adding per-route titles, meta descriptions, Open Graph, Twitter card, or canonical tags in a Lovable SPA (React + Vite). Not for static HTML edits or content-only changes.
In this repository56 other files it gives its agents.
- accessibility-passSkill
- analytics-eventsSkill
- api-error-handlingSkill
- audit-logging-backendSkill
- background-jobs-and-cronSkill
- dark-mode-and-themingSkill
- dashboard-charts-rechartsSkill
- edge-functions-and-webhooksSkill
- email-and-notificationsSkill
- error-states-and-empty-uiSkill
- feature-flags-and-togglesSkill
- file-upload-storageSkill
- i18n-multi-languageSkill
- lovable-prompting-playbookSkill
- lovable-ship-checklistSkill
- migration-playbookSkill
- multi-tenant-backendSkill
- onboarding-copySkill
- optimistic-updatesSkill
- payment-failed-and-recoverySkill
- payment-webhook-idempotencySkill
- payment-webhook-testingSkill
- performance-budgetSkill
- pg-cron-recipesSkill
- pg-cron-scheduled-jobsSkill
- pg-cron-with-pg-net-edgeSkill
- postgres-full-text-searchSkill
- postgres-triggers-and-functionsSkill
- pricing-and-billingSkill
- programmatic-seo-content-qualitySkill
- programmatic-seo-pagesSkill
- rate-limiting-edgeSkill
- realtime-and-subscriptionsSkill
- refactor-safe-diffSkill
- release-notesSkill
- seo-core-web-vitalsSkill
- seo-landing-pageSkill
- seo-sitemap-generationSkill
- seo-ssr-and-prerenderingSkill
- seo-structured-dataSkill
- server-input-validationSkill
- shadcn-patternsSkill
- soft-delete-and-archivingSkill
- stripe-one-time-payment-webhooksSkill
- stripe-payment-webhooksSkill
- supabase-auth-flowsSkill
- supabase-database-designSkill
- supabase-rls-and-authSkill
- support-replySkill
- tanstack-infinite-queriesSkill
- tanstack-mutations-and-invalidationSkill
- tanstack-prefetch-and-hydrationSkill
- tanstack-query-alternativeSkill
- tanstack-router-data-loadersSkill
- tanstack-start-server-routesSkill
- typed-api-hooks-formsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 77
Every public route MUST set:
- Distinctive: line 120
Use at the top of every page:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SEO meta tags for SPAs
SPAs need per-route title + meta tags, but index.html only has one. Use one of these mechanisms consistently — never mix.
Companion skills: seo-ssr-and-prerendering, seo-structured-data, seo-landing-page.
Choose one approach
| Option | When | Notes |
React 19 native (<title>, <meta> in JSX) | React 19+ projects | Built-in, no library, hoisted to <head> |
react-helmet-async | React 18 and earlier, or you need SSR with collected tags | Battle-tested, SSR-friendly |
@unhead/react | Modern alternative, smaller than helmet | Works for SSR + SPA |
For Lovable's current default React version, prefer React 19 native tags if available, otherwise react-helmet-async.
React 19 native (preferred)
function PricingPage() {
return (
<>
<title>Pricing — Acme</title>
<meta name="description" content="Simple per-seat pricing. Start free." />
<link rel="canonical" href="https://acme.com/pricing" />
<meta property="og:title" content="Acme Pricing" />
<meta property="og:description" content="Simple per-seat pricing. Start free." />
<meta property="og:image" content="https://acme.com/og/pricing.png" />
<meta property="og:url" content="https://acme.com/pricing" />
<meta name="twitter:card" content="summary_large_image" />
<main>{/* ... */}</main>
</>
);
}React lifts these to <head> automatically; SSR/prerendering captures them.
react-helmet-async (React 18)
import { HelmetProvider, Helmet } from "react-helmet-async";
// once at the root
<HelmetProvider>
<App />
</HelmetProvider>
// per page
function PricingPage() {
return (
<>
<Helmet>
<title>Pricing — Acme</title>
<meta name="description" content="Simple per-seat pricing. Start free." />
<link rel="canonical" href="https://acme.com/pricing" />
<meta property="og:title" content="Acme Pricing" />
<meta property="og:image" content="https://acme.com/og/pricing.png" />
</Helmet>
<main>{/* ... */}</main>
</>
);
}Per-page contract
Every public route MUST set:
| Tag | Length | Notes |
<title> | 50–60 chars | Format: "Page — Brand" |
<meta name="description"> | 140–160 chars | One sentence, action-oriented |
<link rel="canonical"> | absolute URL | Even when there are no obvious duplicates |
og:title, og:description, og:image, og:url | OG image 1200×630 | Required for LinkedIn/Slack previews |
twitter:card | summary_large_image | Required for Twitter/X |
Helper component
Centralize defaults so every page only overrides what's unique:
type SeoProps = {
title: string;
description: string;
path: string;
image?: string;
type?: "website" | "article";
};
export function Seo({ title, description, path, image, type = "website" }: SeoProps) {
const url = `https://acme.com${path}`;
const ogImage = image ?? "https://acme.com/og/default.png";
return (
<>
<title>{`${title} — Acme`}</title>
<meta name="description" content={description} />
<link rel="canonical" href={url} />
<meta property="og:type" content={type} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={url} />
<meta property="og:image" content={ogImage} />
<meta name="twitter:card" content="summary_large_image" />
</>
);
}Use at the top of every page:
<Seo title="Pricing" description="Simple per-seat pricing. Start free." path="/pricing" />Canonicals
- Self-referencing canonical on every page (yes, even the home page).
- For paginated pages, canonical to the first page or self-canonical per page; do not canonical all pages to
/blog. - For UTM-tagged URLs, canonical to the clean URL.
Open Graph images
- 1200×630 PNG/JPG, < 1 MB, no transparency.
- Programmatic images: see
programmatic-seo-pages— generate per-page OG via Satori or an edge function.
Verify
- View source of the rendered HTML — tags must be present (matters when prerendering / SSR).
- Twitter Card Validator
- Facebook Sharing Debugger
- LinkedIn Post Inspector
Avoid
- Identical
<title>on every route. - Description duplicated across pages.
- OG image missing or > 5 MB.
- Mixing
react-helmet-asyncand React 19 native tags — one wins, the other is dropped silently. - Canonical pointing to
/from every page.
Checklist
- One
Seohelper used everywhere. - Each public route has unique title and description.
- Canonical set absolute, per-page.
- OG image generated and validated in three external debuggers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

