Skip to content

Commit

Permalink
fix(nx-dev): ensure og image is generated for all docs (#18617)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Aug 14, 2023
1 parent d1ffe58 commit b749b47
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions scripts/documentation/open-graph/generate-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,30 @@ const targetFolder: string = resolve(
);

const data: { title: string; content: string; filename: string }[] = [];
documents.map((category) => {
documents.forEach((category) => {
data.push({
title: category.name,
content: category.description,
filename: [category.sidebarId, category.id].filter(Boolean).join('-'),
});
category.itemList.map((item) =>
category.itemList.forEach((item) => {
data.push({
title: item.name,
content: category.name,
content: item.description || category.name,
filename: [category.sidebarId, category.id, item.id]
.filter(Boolean)
.join('-'),
})
);
});
item.itemList?.forEach((subItem) => {
data.push({
title: subItem.name,
content: subItem.description || category.name,
filename: [category.sidebarId, category.id, item.id, subItem.id]
.filter(Boolean)
.join('-'),
});
});
});
});
packages.map((pkg) => {
data.push({
Expand Down Expand Up @@ -137,7 +146,7 @@ function splitLines(
if (words.length <= 1) {
return words;
}
const lines = [];
const lines: string[] = [];
let currentLine = words[0];

for (let i = 1; i < words.length; i++) {
Expand Down

1 comment on commit b749b47

@vercel
Copy link

@vercel vercel bot commented on b749b47 Aug 14, 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-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.