wire to the config attribute

This commit is contained in:
sebastien 2025-07-04 13:13:23 +02:00
parent 98469e1099
commit 650f51662a
8 changed files with 24 additions and 13 deletions

View file

@ -12,6 +12,7 @@ import {
posixPath,
getFileCommitDate,
LAST_UPDATE_FALLBACK,
getCurrentLocaleConfig,
} from '@docusaurus/utils';
import {DEFAULT_FUTURE_CONFIG} from '@docusaurus/core/src/server/configValidation';
import pluginContentBlog from '../index';
@ -100,7 +101,7 @@ const getPlugin = async (
const localizationDir = path.join(
siteDir,
i18n.path,
i18n.localeConfigs[i18n.currentLocale]!.path,
getCurrentLocaleConfig(i18n).path,
);
const siteConfig = {
title: 'Hello',

View file

@ -19,6 +19,7 @@ import {
getDataFilePath,
DEFAULT_PLUGIN_ID,
resolveMarkdownLinkPathname,
getCurrentLocaleConfig,
} from '@docusaurus/utils';
import {getTagsFilePathsToWatch} from '@docusaurus/utils-validation';
import {createMDXLoaderItem} from '@docusaurus/mdx-loader';
@ -73,10 +74,10 @@ export default async function pluginContentBlog(
const {baseUrl} = siteConfig;
const shouldLocalize = false;
const shouldTranslate = getCurrentLocaleConfig(context.i18n).translate;
const contentPaths: BlogContentPaths = {
contentPath: path.resolve(siteDir, options.path),
contentPathLocalized: shouldLocalize
contentPathLocalized: shouldTranslate
? getPluginI18nPath({
localizationDir,
pluginName: PluginName,