File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,10 +204,13 @@ class ContentModel extends ContentModelEntryNode {
204204 }
205205
206206 const nodes = [
207+ ...this . subtree . assets ,
207208 ...this . subtree . subpages ,
208209 ...this . subtree . collections ,
209210 ...flatMapDeepCategories ( this . subtree . collections ) ,
210- ..._ . flatMap ( this . subtree . collections , ( { subtree } ) => subtree . posts )
211+ ..._ . flatMapDeep ( this . subtree . collections , ( { subtree } ) => {
212+ return subtree . posts . map ( post => [ post , post . subtree . attachments ] )
213+ } )
211214 ]
212215
213216 nodes . forEach ( node => node . resolveLinks ( nodes ) )
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ const { join } = require('path')
22const _ = require ( 'lodash' )
33const { makePermalink } = require ( './contentModelHelpers' )
44const ContentModelNode = require ( './ContentModelNode' )
5+ const { addLinkBack, serializeLinks, resolveLinks } = require ( './linking' )
56
67class ContentModelResourceNode extends ContentModelNode {
78 constructor ( fsNode , context , settings = { } ) {
89 super ( fsNode , context , settings )
10+ this . slug = this . title
911 this . permalink = this . getPermalink ( )
1012 this . outputPath = this . getOutputPath ( )
1113 this . subtreeMatchers = this . getSubtreeMatchers ( )
@@ -38,6 +40,18 @@ class ContentModelResourceNode extends ContentModelNode {
3840 return { }
3941 }
4042
43+ addLinkBack ( post , key ) {
44+ addLinkBack ( this , post , key )
45+ }
46+
47+ resolveLinks ( nodes ) {
48+ resolveLinks ( this , nodes )
49+ }
50+
51+ serializeLinks ( ) {
52+ return serializeLinks ( this )
53+ }
54+
4155 afterEffects ( contentModel ) { }
4256
4357 render ( renderer ) { }
You can’t perform that action at this time.
0 commit comments