Update Meta Component
1 minute read
Meta.svelte now self-resolves title, description, and SEO tags using a synchronous import.meta.glob PageMeta lookup keyed by the current pathname via $app/state.
Props are still accepted as fallbacks for pages without PageMeta exports (error page).
What Changed
Meta.svelte
Builds a pages map via import.meta.glob and resolves pages[page.url.pathname]. Title and description come from PageMeta with prop fallbacks. New tags added:
<link rel="canonical">fromcanonical<meta name="robots">fromnoindex<meta property="og:locale">fromlang<meta name="keywords">fromtags
Publication / PublicationHead
meta prop removed from Publication and PublicationHead. <Meta /> is now called with
no props.
Page meta exports
Added description field to every page's PageMeta export, migrated from the former Publication meta prop.
Read next