fix(nx-dev): ensure og image is generated for all docs (#18617)
This commit is contained in:
parent
d1ffe58644
commit
b749b479a2
@ -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({
|
||||
@ -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++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user