Skip to content

Commit efea25b

Browse files
committed
Fix linking by adding missing 'subtree's in place
After the last changes made in category and collection, linking became out of date. This fixes it.
1 parent b7c11fd commit efea25b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/contentModel/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const findLinkedEntry = (contentModel, link) => {
3232

3333
for (const categorySlug of link.categorySlugs) {
3434
const categorySlugRe = new RegExp(categorySlug, 'i')
35-
const category = container.categories?.find(c => c.slug.match(categorySlugRe))
35+
const category = container.subtree.categories?.find(c => c.slug.match(categorySlugRe))
3636
if (!category) {
3737
break
3838
}
@@ -46,12 +46,12 @@ const findLinkedEntry = (contentModel, link) => {
4646
if (node.slug?.match(entrySlugRe)) {
4747
return node
4848
}
49-
const match = node.levelPosts?.find(p => p.slug.match(entrySlugRe))
49+
const match = node.subtree.levelPosts?.find(p => p.slug.match(entrySlugRe))
5050
if (match) {
5151
return match
5252
}
53-
if (node.categories) {
54-
queue.push(...node.categories)
53+
if (node.subtree.categories) {
54+
queue.push(...node.subtree.categories)
5555
}
5656
}
5757

0 commit comments

Comments
 (0)