Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
OzakIOne committed Apr 10, 2024
1 parent 0c058f0 commit cd5223e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/docusaurus-plugin-content-pages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default function pluginContentPages(

async loadContent() {
const {include} = options;
console.log('options:', options);

if (!(await fs.pathExists(contentPaths.contentPath))) {
return null;
Expand Down Expand Up @@ -166,11 +165,10 @@ export default function pluginContentPages(
): Promise<RouteMetadata> {
if (metadata.type === 'mdx') {
const lastUpdate = await readLastUpdateData(
metadata.source,
aliasedSitePathToRelativePath(metadata.source),
options,
metadata.frontMatter.last_update,
);

return {
sourceFilePath: aliasedSitePathToRelativePath(metadata.source),
// TODO add support for last updated date in the page plugin
Expand All @@ -189,7 +187,8 @@ export default function pluginContentPages(
await Promise.all(
content.map(async (metadata) => {
const {permalink, source} = metadata;
const routeMetadata = createPageRouteMetadata(metadata);
const routeMetadata = await createPageRouteMetadata(metadata);
console.log('routeMetadata:', routeMetadata);
if (metadata.type === 'mdx') {
await createData(
// Note that this created data path must be in sync with
Expand All @@ -201,7 +200,7 @@ export default function pluginContentPages(
path: permalink,
component: options.mdxPageComponent,
exact: true,
metadata: await routeMetadata,
metadata: routeMetadata,
modules: {
content: source,
},
Expand All @@ -211,7 +210,7 @@ export default function pluginContentPages(
path: permalink,
component: source,
exact: true,
metadata: await routeMetadata,
metadata: routeMetadata,
modules: {
config: `@generated/docusaurus.config`,
},
Expand Down

0 comments on commit cd5223e

Please sign in to comment.