mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-01 16:00:29 +02:00
wire to the config attribute
This commit is contained in:
parent
98469e1099
commit
650f51662a
8 changed files with 24 additions and 13 deletions
|
@ -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',
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue