Skip to content

getOgImagePageSlug

Resolves the public Open Graph image slug for a documentation page.

Import:

import { getOgImagePageSlug } from '@mnaoumov/typescript-dev-toolkit/docs-site/og-image-page';

Signature:

function getOgImagePageSlug(frontmatter: Record<string, unknown>, filePath: string, contentDocsDirectory: string): string

Parameters:

Parameter Type Description
frontmatter Record<string, unknown> The page’s parsed frontmatter.
filePath string The page’s source-file path.
contentDocsDirectory string The documentation content root.

Returns: string — The case-preserved explicit slug, or a slug derived from the file path.