Skip to content

Commit a0acc8a

Browse files
committed
build
1 parent ba715f6 commit a0acc8a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

lib/server/docs.plugin.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ class DocsPlugin {
5050
const bar = progress.defaultBar();
5151
bar.start(this.docs.length, 0, { prefix: 'rendering images', suffix: '-' });
5252
for (const doc of this.docs) {
53-
console.log("doc", doc);
54-
if (doc.metadata.permalink === "/") {
55-
doc.metadata.permalink = "/index";
56-
}
5753
const document = new document_1.Document(this.getHtmlPath(doc));
5854
bar.update({ suffix: doc.metadata.permalink });
5955
await document.load();
@@ -76,7 +72,7 @@ class DocsPlugin {
7672
logger_1.default.success('Generated og images for docs pages');
7773
};
7874
getHtmlPath = (doc) => doc.metadata?.permalink &&
79-
path.join(this.stripLangFromPath(this.context.outDir), `${doc.metadata.permalink}.html`);
75+
path.join(this.stripLangFromPath(this.context.outDir), `${doc.metadata.permalink}${doc.metadata.permalink.endsWith("/") ? "index" : ""}.html`);
8076
stripLangFromPath = (path) => {
8177
const lang = this.context.i18n.locales.find((locale) => path.endsWith(`/${locale}`));
8278
return lang ? path.slice(0, -lang.length - 1) : path;

0 commit comments

Comments
 (0)