Files
ipal-kit/dist/modules/seo/composeTitle.d.ts
T

26 lines
946 B
TypeScript

/** Which part comes first in a composed title. */
export type TitleOrder = 'page-first' | 'site-first';
type ComposeTitleArgs = {
/** Page-specific title, e.g. 'About Us'. */
pageTitle?: string | null;
/** Site name, e.g. 'Acme Inc'. */
siteName?: string | null;
/** Separator between page title and site name. Defaults to ' | '. */
separator?: string;
/** Defaults to 'page-first' — the page title is what a visitor scans for. */
order?: TitleOrder;
};
/**
* Composes a full document title from a page title and the site name.
*
* - both, page-first: "About Us | Acme Inc"
* - both, site-first: "Acme Inc | About Us"
* - page only: "About Us"
* - site only: "Acme Inc"
* - neither: ""
*
* Pure function — no dependency on Payload or request state.
*/
export declare function composeTitle({ pageTitle, siteName, separator, order, }: ComposeTitleArgs): string;
export {};