feat(v2): implement ComponentCreator (#1366)

* v2(feat): convert blog to view-driven content queries

* feat(v2): port blog to use ContentRenderer

* misc(v2): fix test and change ContentRenderer url

* avoid chunkName collision

* avoid chunkname collision more

* fix(v2): fix content-renderer ssr problem (#1367)

* wip

* avoid chunk names collision

* ContentRenderer is a wrapper for Loadable

* convert docs and pages

* nits and rename

* rename routeModules -> modules

* remove lodash from component creator

* resolve chunk not being picked up correctly

* add comment for explanation

* small refactoring
This commit is contained in:
Yangshun Tay 2019-04-16 07:18:29 -07:00 committed by Endilie Yacop Sucipto
parent 0ac2441d23
commit 96cb4672d5
14 changed files with 220 additions and 80 deletions

View file

@ -129,13 +129,18 @@ class DocusaurusPluginContentBlog {
path: permalink,
component: blogPageComponent,
metadata: metadataItem,
modules: metadataItem.posts.map(post => ({
path: post.source,
query: {
truncated: true,
},
})),
modules: {
entries: metadataItem.posts.map(post => ({
// To tell routes.js this is an import and not a nested object to recurse.
__import: true,
path: post.source,
query: {
truncated: true,
},
})),
},
});
return;
}
@ -143,7 +148,9 @@ class DocusaurusPluginContentBlog {
path: permalink,
component: blogPostComponent,
metadata: metadataItem,
modules: [metadataItem.source],
modules: {
content: metadataItem.source,
},
});
});
}