@docusaurus/plugin-content-blog 3.8.1-canary-6361 → 3.8.1-canary-6364
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/blogUtils.js +3 -1
- package/lib/index.js +8 -5
- package/package.json +10 -10
- package/src/blogUtils.ts +3 -1
- package/src/index.ts +9 -5
package/lib/blogUtils.js
CHANGED
|
@@ -194,7 +194,9 @@ async function processBlogSourceFile(blogSourceRelative, contentPaths, context,
|
|
|
194
194
|
}
|
|
195
195
|
else if (typeof editUrl === 'string') {
|
|
196
196
|
const isLocalized = blogDirPath === contentPaths.contentPathLocalized;
|
|
197
|
-
const fileContentPath = isLocalized &&
|
|
197
|
+
const fileContentPath = isLocalized &&
|
|
198
|
+
options.editLocalizedFiles &&
|
|
199
|
+
contentPaths.contentPathLocalized
|
|
198
200
|
? contentPaths.contentPathLocalized
|
|
199
201
|
: contentPaths.contentPath;
|
|
200
202
|
const contentPathEditUrl = (0, utils_1.normalizeUrl)([
|
package/lib/index.js
CHANGED
|
@@ -30,13 +30,16 @@ async function pluginContentBlog(context, options) {
|
|
|
30
30
|
logger_1.default.warn(`${PluginName} feed feature does not support the Hash Router. Feeds won't be generated.`);
|
|
31
31
|
}
|
|
32
32
|
const { baseUrl } = siteConfig;
|
|
33
|
+
const shouldTranslate = (0, utils_1.getLocaleConfig)(context.i18n).translate;
|
|
33
34
|
const contentPaths = {
|
|
34
35
|
contentPath: path_1.default.resolve(siteDir, options.path),
|
|
35
|
-
contentPathLocalized:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
contentPathLocalized: shouldTranslate
|
|
37
|
+
? (0, utils_1.getPluginI18nPath)({
|
|
38
|
+
localizationDir,
|
|
39
|
+
pluginName: PluginName,
|
|
40
|
+
pluginId: options.id,
|
|
41
|
+
})
|
|
42
|
+
: undefined,
|
|
40
43
|
};
|
|
41
44
|
const pluginId = options.id ?? utils_1.DEFAULT_PLUGIN_ID;
|
|
42
45
|
const pluginDataDirRoot = path_1.default.join(generatedFilesDir, PluginName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "3.8.1-canary-
|
|
3
|
+
"version": "3.8.1-canary-6364",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@docusaurus/core": "3.8.1-canary-
|
|
35
|
-
"@docusaurus/logger": "3.8.1-canary-
|
|
36
|
-
"@docusaurus/mdx-loader": "3.8.1-canary-
|
|
37
|
-
"@docusaurus/theme-common": "3.8.1-canary-
|
|
38
|
-
"@docusaurus/types": "3.8.1-canary-
|
|
39
|
-
"@docusaurus/utils": "3.8.1-canary-
|
|
40
|
-
"@docusaurus/utils-common": "3.8.1-canary-
|
|
41
|
-
"@docusaurus/utils-validation": "3.8.1-canary-
|
|
34
|
+
"@docusaurus/core": "3.8.1-canary-6364",
|
|
35
|
+
"@docusaurus/logger": "3.8.1-canary-6364",
|
|
36
|
+
"@docusaurus/mdx-loader": "3.8.1-canary-6364",
|
|
37
|
+
"@docusaurus/theme-common": "3.8.1-canary-6364",
|
|
38
|
+
"@docusaurus/types": "3.8.1-canary-6364",
|
|
39
|
+
"@docusaurus/utils": "3.8.1-canary-6364",
|
|
40
|
+
"@docusaurus/utils-common": "3.8.1-canary-6364",
|
|
41
|
+
"@docusaurus/utils-validation": "3.8.1-canary-6364",
|
|
42
42
|
"cheerio": "1.0.0-rc.12",
|
|
43
43
|
"feed": "^4.2.2",
|
|
44
44
|
"fs-extra": "^11.1.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
63
63
|
"tree-node-cli": "^1.6.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "eb21e3eaf84009a29feff55780bb5d3a76658d01"
|
|
66
66
|
}
|
package/src/blogUtils.ts
CHANGED
|
@@ -323,7 +323,9 @@ async function processBlogSourceFile(
|
|
|
323
323
|
} else if (typeof editUrl === 'string') {
|
|
324
324
|
const isLocalized = blogDirPath === contentPaths.contentPathLocalized;
|
|
325
325
|
const fileContentPath =
|
|
326
|
-
isLocalized &&
|
|
326
|
+
isLocalized &&
|
|
327
|
+
options.editLocalizedFiles &&
|
|
328
|
+
contentPaths.contentPathLocalized
|
|
327
329
|
? contentPaths.contentPathLocalized
|
|
328
330
|
: contentPaths.contentPath;
|
|
329
331
|
|
package/src/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
getDataFilePath,
|
|
20
20
|
DEFAULT_PLUGIN_ID,
|
|
21
21
|
resolveMarkdownLinkPathname,
|
|
22
|
+
getLocaleConfig,
|
|
22
23
|
} from '@docusaurus/utils';
|
|
23
24
|
import {getTagsFilePathsToWatch} from '@docusaurus/utils-validation';
|
|
24
25
|
import {createMDXLoaderItem} from '@docusaurus/mdx-loader';
|
|
@@ -73,13 +74,16 @@ export default async function pluginContentBlog(
|
|
|
73
74
|
|
|
74
75
|
const {baseUrl} = siteConfig;
|
|
75
76
|
|
|
77
|
+
const shouldTranslate = getLocaleConfig(context.i18n).translate;
|
|
76
78
|
const contentPaths: BlogContentPaths = {
|
|
77
79
|
contentPath: path.resolve(siteDir, options.path),
|
|
78
|
-
contentPathLocalized:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
contentPathLocalized: shouldTranslate
|
|
81
|
+
? getPluginI18nPath({
|
|
82
|
+
localizationDir,
|
|
83
|
+
pluginName: PluginName,
|
|
84
|
+
pluginId: options.id,
|
|
85
|
+
})
|
|
86
|
+
: undefined,
|
|
83
87
|
};
|
|
84
88
|
const pluginId = options.id ?? DEFAULT_PLUGIN_ID;
|
|
85
89
|
|