feat(core): allow customizing the i18n directory path (#7386)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Joshua Chen 2022-06-02 23:37:14 +08:00 committed by GitHub
parent c07a514730
commit abe5450526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 147 additions and 166 deletions

View file

@ -55,19 +55,16 @@ export function getVersionSidebarsPath(
}
export function getDocsDirPathLocalized({
siteDir,
locale,
localizationDir,
pluginId,
versionName,
}: {
siteDir: string;
locale: string;
localizationDir: string;
pluginId: string;
versionName: string;
}): string {
return getPluginI18nPath({
siteDir,
locale,
localizationDir,
pluginName: 'docusaurus-plugin-content-docs',
pluginId,
subPaths: [
@ -175,8 +172,7 @@ export async function getVersionMetadataPaths({
> {
const isCurrent = versionName === CURRENT_VERSION_NAME;
const contentPathLocalized = getDocsDirPathLocalized({
siteDir: context.siteDir,
locale: context.i18n.currentLocale,
localizationDir: context.localizationDir,
pluginId: options.id,
versionName,
});