fix gethtmlpath

This commit is contained in:
Evan Simkowitz
2024-10-08 14:19:38 -04:00
parent 55f297255a
commit ea73c01b82
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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;
+1
View File
@@ -1,3 +1,4 @@
/// <reference types="@docusaurus/plugin-content-blog/src/plugin-content-blog.js" />
import { BlogPaginated, BlogPost, BlogTag, PluginOptions } from '@docusaurus/plugin-content-blog';
import { Document } from '../document';
export type BlogPageType = 'post' | 'list' | 'archive' | 'tags' | 'tag' | 'archive';
+1 -1
View File
@@ -100,7 +100,7 @@ export class DocsPlugin {
getHtmlPath = (doc: Partial<DocsPageData>) =>
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