UNPKG

@mintlify/prebuild

Version:

Helpful functions for Mintlify's prebuild step

23 lines (22 loc) 826 B
import { getTags, getUpdateDescription, getUpdateTitle, getRssPropsData, } from '@mintlify/common'; export const mdxToRssUpdates = (mdxUpdates) => { const updates = []; for (const updateComponent of mdxUpdates) { const date = new Date().toISOString(); const { rssTitle, rssDescription } = getRssPropsData(updateComponent); const label = getUpdateTitle(updateComponent); const title = rssTitle || label; const description = rssDescription || getUpdateDescription(updateComponent); const tags = getTags(updateComponent); if (label && title) { updates.push({ title, anchor: label, date, description, categories: tags, }); } } return updates; };