@mintlify/prebuild 1.0.530 → 1.0.532

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import { RSSItem } from '@mintlify/common';
2
2
  import { Root } from 'mdast';
3
- export declare const mdxToRssUpdates: (tree: Root) => RSSItem[];
3
+ export declare const mdxToRssUpdates: (tree: Root, existingUpdates: RSSItem[]) => RSSItem[];
@@ -1,5 +1,5 @@
1
1
  import { getTags, isUpdate } from '@mintlify/common';
2
- export const mdxToRssUpdates = (tree) => {
2
+ export const mdxToRssUpdates = (tree, existingUpdates) => {
3
3
  let updates = [];
4
4
  const updateComponents = tree.children.filter((child) => isUpdate(child));
5
5
  for (const updateComponent of updateComponents) {
@@ -10,9 +10,14 @@ export const mdxToRssUpdates = (tree) => {
10
10
  const validTitle = label?.toString() || undefined;
11
11
  const validDescription = description?.toString() || '';
12
12
  const validTags = tags.length > 0 ? tags : undefined;
13
- if (validTitle) {
13
+ const existingUpdate = existingUpdates.find((update) => update.title === validTitle);
14
+ if (existingUpdate && existingUpdate.date) {
15
+ updates.push(existingUpdate);
16
+ }
17
+ else if (validTitle) {
14
18
  updates.push({
15
19
  title: validTitle,
20
+ date: new Date().toISOString(),
16
21
  description: validDescription,
17
22
  categories: validTags,
18
23
  });
@@ -10,7 +10,7 @@ export const writeRssFiles = async (docsConfig, rssPages) => {
10
10
  const { targetPath, tree } = page;
11
11
  const { title, description } = pageToRss(tree);
12
12
  const rssPath = pathToRss(targetPath);
13
- const updates = mdxToRssUpdates(tree);
13
+ const updates = mdxToRssUpdates(tree, []);
14
14
  return {
15
15
  rssPath,
16
16
  orgName,