Skip to Content

SEO

What the P1 starter kit gives you out of the box for classic search-engine optimization, and the plan for closing the gaps it doesn’t cover. Read directly from the scaffolded starter kit’s source (lib/seo-metadata.ts, lib/page-seo.ts), not assumed.

Natively supported

Per-page metadata, resolved through lib/page-seo.tsbuildPageMetadata() in lib/seo-metadata.ts, sourced from root.props._seo/root.props._meta on the page’s own Puck data:

  • <title> and meta description
  • Canonical URL, but only when NEXT_PUBLIC_SITE_URL is set. Deliberately: an unset env var would otherwise resolve a canonical against localhost, and the scaffold’s own code comment is explicit that a wrong canonical is worse than none.
  • Open Graph: type (website/article/book/profile), title, description, url, siteName, image, locale
  • Twitter Card: card type, title, image
  • metadataBase, set in app/layout.tsx (again gated on NEXT_PUBLIC_SITE_URL) so relative OG/Twitter image URLs resolve correctly instead of silently breaking

Fallback chain, not just presence/absence: page value → site-wide default (ogImage/ogLocale, from the backend’s SeoMetadata payload) → derived from title/description → omitted entirely. An untitled, imageless page gets no Twitter tags at all rather than empty ones. Next renders nothing useful from an empty card, so the scaffold skips it outright.

Template-token support in SEO fields is the standout feature here. Title, description, and every free-text OG/Twitter field accept {{ }} expressions, resolved against the page’s data sources at render time (lib/page-seo.ts’s resolvePageMetadata, see Data Sources & Queries for the full mechanism). That means a single dynamic-route template (/company/leadership/:name, see Dynamic (templated) routes) can produce correct, unique per-record titles and descriptions for every generated page, not one static title for the whole template. For a product catalog or a large recipe collection, this is the difference between real per-page SEO and one generic title copy-pasted across hundreds of URLs.

Not natively supported

Confirmed absent by direct search: no matches anywhere in the scaffolded app or the installed @pantheon-systems/* SDK packages: sitemap.xml, robots.txt, redirects, and JSON-LD/structured data. All four are real, launch-relevant gaps, and all four are tracked together, with their build plans, on Sitemap, Structured Data & Redirects under Missing Features, not on this page.

None of this is unique to P1. Plenty of Next.js starters ship without a sitemap or JSON-LD either. The point isn’t that P1 is deficient; it’s that these are real gaps in this specific scaffold. What’s on this page (per-page metadata) is genuinely native and solid; what’s missing is tracked separately so the two don’t get conflated.

Last updated on