From b55a0f754682b5a295ae034dbf870c677ac28ae8 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Mon, 26 Aug 2024 13:39:53 +0800 Subject: [PATCH] fix(theme): incorrect notes auto frontmatter permalink --- theme/src/node/autoFrontmatter/resolveOptions.ts | 2 +- theme/src/node/theme.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/theme/src/node/autoFrontmatter/resolveOptions.ts b/theme/src/node/autoFrontmatter/resolveOptions.ts index 3b47f548..1d7477a8 100644 --- a/theme/src/node/autoFrontmatter/resolveOptions.ts +++ b/theme/src/node/autoFrontmatter/resolveOptions.ts @@ -147,7 +147,7 @@ export function resolveOptions( const note = findNote(relativePath) const prefix = notes?.link || '' const args: string[] = [ - locale, + prefix.startsWith(locale) ? '/' : locale, prefix, note?.link || '', ] diff --git a/theme/src/node/theme.ts b/theme/src/node/theme.ts index e7834a72..c56c62c4 100644 --- a/theme/src/node/theme.ts +++ b/theme/src/node/theme.ts @@ -78,6 +78,7 @@ export function plumeTheme(options: PlumeThemeOptions = {}): Theme { await prepareData(app) }) const { localeOptions } = await waitForConfigLoaded() + await waitForAutoFrontmatter() await prepareThemeData(app, localeOptions) await prepareData(app) },