A universal and modern library for SEO and GEO optimization in Svelte 5 and SvelteKit projects. Simplifies the management of Meta Tags, Open Graph, Twitter Cards, and Schema.org JSON-LD with native Runes support.
$props, $derived).WebPage, Article, ProfilePage, and CreativeWork.{@html} and < escaping in payload.npm install quartzo
We recommend using the component in your pages (+page.svelte) receiving data from a load function (+page.server.ts), following SvelteKit SEO best practices.
+page.server.ts)export const load = async () => {
return {
seo: {
title: 'My Awesome Article',
description: 'A complete guide on Svelte 5 and SEO.',
url: '/blog/my-article',
image: '/images/cover.jpg',
imageAlt: 'Article cover with Svelte logo',
publishedDate: '2023-10-27T10:00:00Z',
tags: ['Svelte', 'SEO', 'Web Development'],
breadcrumbs: [
{ name: 'Blog', url: '/blog' },
{ name: 'My Awesome Article', url: '/blog/my-article' }
],
alternates: [
{ hreflang: 'pt-BR', href: '/blog/meu-artigo' },
{ hreflang: 'en-US', href: '/en/blog/my-article' }
]
}
};
};
+page.svelte)<script lang="ts">
import { SeoGeoOptimizer } from 'quartzo';
let { data } = $props();
</script>
<SeoGeoOptimizer
title={data.seo.title}
description={data.seo.description}
url={data.seo.url}
siteUrl="https://mysite.com"
siteName="My Tech Blog"
image={data.seo.image}
imageAlt={data.seo.imageAlt}
type="article"
publishedDate={data.seo.publishedDate}
tags={data.seo.tags}
breadcrumbs={data.seo.breadcrumbs}
alternates={data.seo.alternates}
noindex={false}
author="Daniel Guimarães"
twitterCreator="@heydan_dev"
/>
| Prop | Type | Description | Default |
|---|---|---|---|
title |
string |
Page title (Meta, OG, Twitter) | Required |
description |
string |
Description (Meta, OG, Twitter) | Required |
url |
string |
Canonical URL (relative or absolute) | Required |
siteUrl |
string |
Base site URL (used to resolve relative URLs) | - |
siteName |
string |
Site name (OG) | - |
image |
string |
Featured image URL (OG, Twitter) | - |
imageAlt |
string |
Alternative text for social image | - |
type |
'website' | 'article' | 'profile' | 'creative_work' |
Content type | 'website' |
author |
string |
Author name | - |
language |
string |
Page language (Schema.org) | 'en-US' |
locale |
string |
Locale (Open Graph) | 'en_US' |
twitterCard |
'summary' | 'summary_large_image' |
Twitter card type | Auto (summary_large_image if image exists) |
robots |
string |
General robots directives | - |
googlebot |
string |
Specific googlebot directives | - |
noindex |
boolean |
Force noindex and nofollow | false |
alternates |
Array<{ hreflang: string; href: string }> |
Alternative hreflang links | [] |
breadcrumbs |
Array<{ name: string; url: string }> |
Breadcrumbs for Schema.org | [] |
publisherType |
'Person' | 'Organization' |
Publisher type in Schema.org | 'Organization' |
load function to ensure title and description match the actual content.url.siteUrl to resolve relative paths automatically.noindex, robots, and googlebot for thin pages or low-value variants.alternates for multilingual versions and to avoid cannibalization.Uma biblioteca universal e moderna para otimização de SEO e GEO em projetos Svelte 5 e SvelteKit. Simplifica a gestão de Meta Tags, Open Graph, Twitter Cards e Schema.org JSON-LD com suporte nativo a Runes.
$props, $derived).WebPage, Article, ProfilePage e CreativeWork.{@html} e com escape de < no payload.npm install quartzo
Recomendamos usar o componente em suas páginas (+page.svelte) recebendo dados de uma load function (+page.server.ts), conforme as melhores práticas de SEO para SvelteKit.
+page.server.ts)export const load = async () => {
return {
seo: {
title: 'Meu Artigo Incrível',
description: 'Um guia completo sobre Svelte 5 e SEO.',
url: '/blog/meu-artigo',
image: '/images/cover.jpg',
imageAlt: 'Capa do artigo com logo Svelte',
publishedDate: '2023-10-27T10:00:00Z',
tags: ['Svelte', 'SEO', 'Web Development'],
breadcrumbs: [
{ name: 'Blog', url: '/blog' },
{ name: 'Meu Artigo Incrível', url: '/blog/meu-artigo' }
],
alternates: [
{ hreflang: 'pt-BR', href: '/blog/meu-artigo' },
{ hreflang: 'en-US', href: '/en/blog/my-article' }
]
}
};
};
+page.svelte)<script lang="ts">
import { SeoGeoOptimizer } from 'quartzo';
let { data } = $props();
</script>
<SeoGeoOptimizer
title={data.seo.title}
description={data.seo.description}
url={data.seo.url}
siteUrl="https://meusite.com"
siteName="Meu Blog Tech"
image={data.seo.image}
imageAlt={data.seo.imageAlt}
type="article"
publishedDate={data.seo.publishedDate}
tags={data.seo.tags}
breadcrumbs={data.seo.breadcrumbs}
alternates={data.seo.alternates}
noindex={false}
author="Daniel Guimarães"
twitterCreator="@heydan_dev"
/>
| Prop | Tipo | Descrição | Default |
|---|---|---|---|
title |
string |
Título da página (Meta, OG, Twitter) | Obrigatório |
description |
string |
Descrição (Meta, OG, Twitter) | Obrigatório |
url |
string |
URL canônica (relativa ou absoluta) | Obrigatório |
siteUrl |
string |
URL base do site (usado para resolver URLs relativas) | - |
siteName |
string |
Nome do site (OG) | - |
image |
string |
URL da imagem de destaque (OG, Twitter) | - |
imageAlt |
string |
Texto alternativo da imagem social | - |
type |
'website' | 'article' | 'profile' | 'creative_work' |
Tipo de conteúdo | 'website' |
author |
string |
Nome do autor | - |
language |
string |
Idioma da página (Schema.org) | 'en-US' |
locale |
string |
Locale (Open Graph) | 'en_US' |
twitterCard |
'summary' | 'summary_large_image' |
Tipo do card Twitter | Auto (summary_large_image se tiver imagem) |
robots |
string |
Diretivas gerais para robots | - |
googlebot |
string |
Diretivas específicas para googlebot | - |
noindex |
boolean |
Força noindex e nofollow | false |
alternates |
Array<{ hreflang: string; href: string }> |
Links alternativos hreflang | [] |
breadcrumbs |
Array<{ name: string; url: string }> |
Breadcrumbs para Schema.org | [] |
publisherType |
'Person' | 'Organization' |
Tipo de publisher no Schema.org | 'Organization' |
load function para garantir que o título e descrição correspondam ao conteúdo real.url correta.siteUrl para resolver caminhos relativos automaticamente.noindex, robots e googlebot para páginas finas ou variantes de baixo valor.alternates para versões multilíngues e evitar canibalização.MIT