Skip to content

setFrontmatter

Sets the front matter of a given content string.

Import:

import { setFrontmatter } from 'obsidian-dev-utils/obsidian/frontmatter';

Signature:

function setFrontmatter(content: string, newFrontmatter: object): string

Parameters:

ParameterTypeDescription
contentstringThe content string to set the front matter in.
newFrontmatterobjectThe new front matter to set.

Returns: string — The new content string with the front matter set.