Skip to content
0

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 ​

ParameterTypeDescription
configSiteConfigThe site config (same shape the docs site uses).

Returns ​

SiteConfig

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>

Released under the MIT License.