mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix gethtmlpath
This commit is contained in:
@@ -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;
|
||||
|
||||
Vendored
+1
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user