Skip to content

Commit e5fd0d5

Browse files
authored
fix(nx-dev): generate all open graph images (#18433)
1 parent f02d230 commit e5fd0d5

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

scripts/documentation/open-graph/generate-images.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,24 @@ import { resolve } from 'path';
66
const mapJson = readJSONSync('./docs/map.json', 'utf8').content;
77

88
const documents: any[] = [
9-
...mapJson.find((x) => x.id === 'nx-documentation')?.['itemList'],
9+
...mapJson
10+
.find((x) => x.id === 'nx-documentation')
11+
?.['itemList'].map((item) => {
12+
item.sidebarId = '';
13+
return item;
14+
}),
15+
...mapJson
16+
.find((x) => x.id === 'extending-nx')
17+
?.['itemList'].map((item) => {
18+
item.sidebarId = 'extending-nx';
19+
return item;
20+
}),
21+
...mapJson
22+
.find((x) => x.id === 'nx-cloud-documentation')
23+
?.['itemList'].map((item) => {
24+
item.sidebarId = 'nx-cloud';
25+
return item;
26+
}),
1027
].filter(Boolean);
1128

1229
const packages: PackageMetadata[] = readJSONSync(
@@ -23,13 +40,15 @@ documents.map((category) => {
2340
data.push({
2441
title: category.name,
2542
content: category.description,
26-
filename: [category.id].join('-'),
43+
filename: [category.sidebarId, category.id].filter(Boolean).join('-'),
2744
});
2845
category.itemList.map((item) =>
2946
data.push({
3047
title: item.name,
3148
content: category.name,
32-
filename: [category.id, item.id].join('-'),
49+
filename: [category.sidebarId, category.id, item.id]
50+
.filter(Boolean)
51+
.join('-'),
3352
})
3453
);
3554
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy