Skip to content

Commit

Permalink
fix(docusaurus-og): fix archive page permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed Jun 21, 2023
1 parent 650fd8c commit a743b7d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/docusaurus-og/src/server/blog.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ export class BlogPlugin {
}

if (options.archiveBasePath) {
const filePath = this.getHtmlPath(
options.archiveBasePath,
const permalink = path.join(
'/',
options.routeBasePath,
options.archiveBasePath,
)

fs.existsSync(filePath) &&
fs.existsSync(this.getHtmlPath(permalink)) &&
this.pages.push({
plugin: options,
pageType: 'archive',
data: { permalink: options.archiveBasePath },
permalink: options.archiveBasePath,
data: { permalink: permalink },
permalink,
})
}

Expand Down Expand Up @@ -128,9 +129,5 @@ export class BlogPlugin {
}

getHtmlPath = (permalink: string, baseUrl?: string) =>
path.join(
this.context.outDir,
!baseUrl ? permalink : path.join('/', baseUrl, permalink),
'index.html',
)
path.join(this.context.outDir, permalink, 'index.html')
}

0 comments on commit a743b7d

Please sign in to comment.