refactor(core): refactor routes generation logic (#7054)

* refactor(core): refactor routes generation logic

* fixes
This commit is contained in:
Joshua Chen 2022-03-29 16:37:29 +08:00 committed by GitHub
parent e31e91ef47
commit 77662260f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 551 additions and 506 deletions

View file

@ -292,19 +292,15 @@ export default async function pluginContentBlog(
exact: true,
modules: {
sidebar: aliasedSource(sidebarProp),
items: items.map((postID) =>
// To tell routes.js this is an import and not a nested object
// to recurse.
({
content: {
__import: true,
path: blogItemsToMetadata[postID]!.source,
query: {
truncated: true,
},
items: items.map((postID) => ({
content: {
__import: true,
path: blogItemsToMetadata[postID]!.source,
query: {
truncated: true,
},
}),
),
},
})),
metadata: aliasedSource(pageMetadataPath),
},
});