Skip to content

Commit 06ef1f6

Browse files
committed
yt-desc fix: github url type does not exist
1 parent 01c8694 commit 06ef1f6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

content/videos/challenges/171-wave-function-collapse/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"description": "GitHub repo for expanded and corrected WFC PCB board example.",
4848
"image": "wfc.jpg",
4949
"urls": {
50-
"github": "https://github.com/CodingTrain/Wave-Function-Collapse"
50+
"other": "https://github.com/CodingTrain/Wave-Function-Collapse"
5151
}
5252
}
5353
],

node-scripts/yt-description.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,14 @@ function writeDescription(video) {
383383
}
384384

385385
// Other Code Examples
386-
const otherCodeExamples = data.codeExamples?.filter(
387-
(ex) => !ex.urls.p5 && !ex.urls.github
388-
);
389386
const getURL = (urls) =>
390387
urls.p5 || urls.processing || urls.node || urls.other;
388+
const otherCodeExamples = data.codeExamples?.filter(
389+
(ex) =>
390+
!ex.urls.p5 &&
391+
getURL(ex.urls) !== repoLink &&
392+
!sketchUrls.includes(getURL(ex.urls))
393+
);
391394
if (otherCodeExamples && otherCodeExamples.length > 0) {
392395
if (otherCodeExamples.length > 1) {
393396
if (sketchUrls?.length > 0 || repoLink) description += '\n';

0 commit comments

Comments
 (0)