diff --git a/lib/server/docs.plugin.js b/lib/server/docs.plugin.js index 5cbd6b4..8be40a4 100644 --- a/lib/server/docs.plugin.js +++ b/lib/server/docs.plugin.js @@ -72,7 +72,7 @@ class DocsPlugin { logger_1.default.success('Generated og images for docs pages'); }; getHtmlPath = (doc) => doc.metadata?.permalink && - path.join(this.stripLangFromPath(this.context.outDir), doc.metadata.permalink, 'index.html'); + path.join(this.stripLangFromPath(this.context.outDir), `${doc.metadata.permalink}.html`); stripLangFromPath = (path) => { const lang = this.context.i18n.locales.find((locale) => path.endsWith(`/${locale}`)); return lang ? path.slice(0, -lang.length - 1) : path; diff --git a/lib/server/types/blog.types.d.ts b/lib/server/types/blog.types.d.ts index 73a7eab..26a0264 100644 --- a/lib/server/types/blog.types.d.ts +++ b/lib/server/types/blog.types.d.ts @@ -1,3 +1,4 @@ +/// import { BlogPaginated, BlogPost, BlogTag, PluginOptions } from '@docusaurus/plugin-content-blog'; import { Document } from '../document'; export type BlogPageType = 'post' | 'list' | 'archive' | 'tags' | 'tag' | 'archive'; diff --git a/src/server/docs.plugin.ts b/src/server/docs.plugin.ts index 4b855e9..092da27 100644 --- a/src/server/docs.plugin.ts +++ b/src/server/docs.plugin.ts @@ -100,7 +100,7 @@ export class DocsPlugin { getHtmlPath = (doc: Partial) => doc.metadata?.permalink && - path.join(this.stripLangFromPath(this.context.outDir), doc.metadata.permalink, 'index.html') + path.join(this.stripLangFromPath(this.context.outDir), `${doc.metadata.permalink}.html`) stripLangFromPath = (path: string) => { const lang = this.context.i18n.locales.find((locale) => path.endsWith(`/${locale}`)) return lang ? path.slice(0, -lang.length - 1) : path