The recommended way to use sk-seo in a multi-page application is to place the <Seo /> component once in your root +layout.svelte and provide SEO data through SvelteKit load functions.
This approach allows you to define global SEO defaults in +layout.js and override them on specific pages using +page.js (or +page.server.js). The component automatically picks up data from the $page.data store.
<!-- +layout.svelte -->
<script>
import Seo from 'sk-seo';
</script>
<Seo />
// +layout.js
export const load = async ({ url }) => {
return {
title: 'Dahoom - Official',
description: 'The official website of Dahoom',
keywords: 'dahoom, official, website'
}
}
// contacts/+page.js
export const load = async ({ url }) => {
// This overrides the title/description/keywords from +layout.js for the /contacts route
return {
title: 'Contacts',
description: 'Where to contact Dahoom AlShaya, whether for business needs or general inquiries',
keywords: 'Contact, business, inquiries',
}
}