Skip to content

Commit

Permalink
fix(nx-dev): generate all open graph images (#18433)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacplmann committed Aug 2, 2023
1 parent f02d230 commit e5fd0d5
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions scripts/documentation/open-graph/generate-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@ import { resolve } from 'path';
const mapJson = readJSONSync('./docs/map.json', 'utf8').content;

const documents: any[] = [
...mapJson.find((x) => x.id === 'nx-documentation')?.['itemList'],
...mapJson
.find((x) => x.id === 'nx-documentation')
?.['itemList'].map((item) => {
item.sidebarId = '';
return item;
}),
...mapJson
.find((x) => x.id === 'extending-nx')
?.['itemList'].map((item) => {
item.sidebarId = 'extending-nx';
return item;
}),
...mapJson
.find((x) => x.id === 'nx-cloud-documentation')
?.['itemList'].map((item) => {
item.sidebarId = 'nx-cloud';
return item;
}),
].filter(Boolean);

const packages: PackageMetadata[] = readJSONSync(
Expand All @@ -23,13 +40,15 @@ documents.map((category) => {
data.push({
title: category.name,
content: category.description,
filename: [category.id].join('-'),
filename: [category.sidebarId, category.id].filter(Boolean).join('-'),
});
category.itemList.map((item) =>
data.push({
title: item.name,
content: category.name,
filename: [category.id, item.id].join('-'),
filename: [category.sidebarId, category.id, item.id]
.filter(Boolean)
.join('-'),
})
);
});
Expand Down

1 comment on commit e5fd0d5

@vercel
Copy link

@vercel vercel bot commented on e5fd0d5 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev

Please sign in to comment.