Skip to content

DefineSeoMetaConfig

katanakit-js / defineSeoMetaConfig

function defineSeoMetaConfig(config): SiteConfig;

Defined in: config/seo.service.ts:146

Registers the site-wide SEO config once — the same define*Config pattern used by the HTTP client and the other services.

After the call, every useSeoMeta(opts) resolves against this config, so pages only pass their own fields. An explicit second argument still wins, so per-call overrides and tests stay possible.

Parameter Type Description
config SiteConfig The site config (same shape the docs site uses).

SiteConfig

The same config, for chaining or reference.

When required blocks (seo, rss) are missing.

import { defineSeoMetaConfig, useSeoMeta } from "katanakit-js";
defineSeoMetaConfig({
site: "https://myblog.com",
title: "My Blog",
description: "Notes on software",
lang: "en",
author: "Ada",
ogImage: "https://myblog.com/og.png",
rss: { enabled: true, path: "/rss.xml", limit: 20 },
seo: {
noindex: false,
canonical: true,
openGraph: true,
twitterCard: true,
jsonLd: true,
},
});
const seo = useSeoMeta({ title: "My Post", description: "A great post" });
// seo.site === "https://myblog.com", seo.html / seo.tags ready for <head>