@mintlify/prebuild
Version:
Helpful functions for Mintlify's prebuild step
13 lines (12 loc) • 427 B
JavaScript
import { isFrontmatter } from '@mintlify/common';
import yaml from 'js-yaml';
export const pageToRss = (tree) => {
let title;
let description;
if (isFrontmatter(tree.children[0])) {
const frontmatterObject = yaml.load(tree.children[0].value);
title = frontmatterObject.title || undefined;
description = frontmatterObject.description || undefined;
}
return { title, description };
};