Skip to content

Commit 9abe08d

Browse files
committed
Call this.getSubtreeMatchers() in model class constructors
...instead of ContentModelEntry. So, model constructors are free to use 'this' in any way they need, and the template methods won't have a problem accessing them.
1 parent c097f9f commit 9abe08d

File tree

6 files changed

+5
-1
lines changed

6 files changed

+5
-1
lines changed

src/compiler/contentModel/models/collection/category.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Category extends ContentModelEntryNode {
7373
super(fsNode, context, settings)
7474

7575
this.facets = []
76+
this.matchers = this.getSubtreeMatchers()
7677
this.subtree = this.parseSubtree()
7778

7879
if (fsNode.isDefaultCategory) {

src/compiler/contentModel/models/collection/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class Collection extends ContentModelEntryNode {
7878

7979
constructor(fsNode, context, settings = defaultSettings) {
8080
super(fsNode, context, settings)
81+
this.matchers = this.getSubtreeMatchers()
8182
this.subtree = this.parseSubtree()
8283
}
8384

src/compiler/contentModel/models/collection/post.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Post extends ContentModelEntryNode {
2828
this.contentType = this.settings.entryContentType
2929
this.schema = this.settings.contentTypes.find(ct => ct.name === this.contentType)
3030

31+
this.matchers = this.getSubtreeMatchers()
3132
this.subtree = this.parseSubtree()
3233
}
3334

src/compiler/contentModel/models/homepage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Homepage extends ContentModelEntryNode {
2020

2121
constructor(fsNode, context, settings = defaultSettings) {
2222
super(fsNode, context, settings)
23+
this.matchers = this.getSubtreeMatchers()
2324
this.subtree = this.parseSubtree()
2425
}
2526

src/compiler/contentModel/models/subpage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Subpage extends ContentModelEntryNode {
2020

2121
constructor(fsNode, context, settings = defaultSettings) {
2222
super(fsNode, context, settings)
23+
this.matchers = this.getSubtreeMatchers()
2324
this.subtree = this.parseSubtree()
2425
}
2526

src/lib/ContentModelEntryNode.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class ContentModelEntryNode extends ContentModelNode {
2222
this.slug = this.getSlug()
2323
this.permalink = this.getPermalink()
2424
this.outputPath = this.getOutputPath()
25-
this.matchers = this.getSubtreeMatchers()
2625
this.subtree = {}
2726
}
2827

0 commit comments

Comments
 (0)