katanakit-js / defineSeoMetaConfig
Function: defineSeoMetaConfig()
ts
function defineSeoMetaConfig(config): SiteConfig;Defined in: src/config/seo.service.ts:151
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.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | SiteConfig | The site config (same shape the docs site uses). |
Returns
The same config, for chaining or reference.
Throws
When required blocks (seo, rss) are missing.
Example
ts
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>