'use client'; import * as Icons from '../Icons'; import ToggleCard from '../fields/ToggleCard'; import type { SectionProps } from './types'; export default function SeoSection({ settings, update, siteUrlInfo, }: SectionProps & { /** Resolved site URL and its origin, so the panel can name SITE_URL (#472). */ siteUrlInfo: { effective: string | null; source: 'env' | 'settings' | 'none' } | null; }) { return (

Search Engine Optimization (SEO)

Customize search engine metadata, OpenGraph tags, and indexing rules.

{/* Live Google Search Result Snippet Card */}
Google Search Result Preview
https://yourportfolio.com ▼
{settings.seo?.title || settings.title || 'My Photography Portfolio'}
{settings.seo?.description || settings.subtitle || 'A curated selection of photography work.'}
update('url', e.target.value)} placeholder="https://folio.example" />

Needed for sitemap.xml, the feed and structured data — those are generated without a request, so the address cannot be derived from it. Leave empty and the sitemap stays empty rather than guessing. {siteUrlInfo?.source === 'env' && ( <>
Currently supplied by the SITE_URL environment variable ( {siteUrlInfo.effective}). A value entered here takes precedence once saved. )}

update('seo.title', e.target.value)} placeholder="Overrides default site title for Google search results" />
update('seo.titleTemplate', e.target.value)} placeholder={`%s | ${settings.seo?.title || settings.title || 'My Portfolio'}`} />

Template for subpages & albums. Use %s as placeholder for the page title.
Preview:{' '} {( settings.seo?.titleTemplate || `%s | ${settings.seo?.title || settings.title || 'My Portfolio'}` ).replace('%s', 'Landscapes')}