@docusaurus/plugin-content-blog 0.0.0-5980 → 0.0.0-5983
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/authors.d.ts +0 -1
- package/lib/authors.js +3 -4
- package/lib/blogUtils.d.ts +0 -1
- package/lib/blogUtils.js +7 -8
- package/lib/client/index.d.ts +0 -1
- package/lib/feed.d.ts +0 -1
- package/lib/feed.js +2 -3
- package/lib/frontMatter.d.ts +0 -1
- package/lib/frontMatter.js +1 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +3 -2
- package/lib/markdownLoader.js +1 -1
- package/lib/options.d.ts +0 -1
- package/lib/options.js +4 -2
- package/lib/props.d.ts +0 -1
- package/lib/props.js +2 -3
- package/lib/remark/footnoteIDFixer.js +1 -1
- package/lib/routes.d.ts +0 -1
- package/lib/routes.js +2 -3
- package/lib/translations.d.ts +0 -1
- package/lib/translations.js +2 -3
- package/package.json +9 -9
- package/src/index.ts +2 -0
- package/src/options.ts +3 -0
package/lib/authors.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { BlogContentPaths } from './types';
|
|
9
8
|
import type { Author, BlogPostFrontMatter } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
export type AuthorsMap = {
|
package/lib/authors.js
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.validateAuthorsMap = validateAuthorsMap;
|
|
10
|
+
exports.getAuthorsMap = getAuthorsMap;
|
|
11
|
+
exports.getBlogPostAuthors = getBlogPostAuthors;
|
|
10
12
|
const utils_1 = require("@docusaurus/utils");
|
|
11
13
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
12
14
|
const AuthorsMapSchema = utils_validation_1.Joi.object()
|
|
@@ -35,7 +37,6 @@ function validateAuthorsMap(content) {
|
|
|
35
37
|
}
|
|
36
38
|
return value;
|
|
37
39
|
}
|
|
38
|
-
exports.validateAuthorsMap = validateAuthorsMap;
|
|
39
40
|
async function getAuthorsMap(params) {
|
|
40
41
|
return (0, utils_1.getDataFileData)({
|
|
41
42
|
filePath: params.authorsMapPath,
|
|
@@ -43,7 +44,6 @@ async function getAuthorsMap(params) {
|
|
|
43
44
|
fileType: 'authors map',
|
|
44
45
|
}, validateAuthorsMap);
|
|
45
46
|
}
|
|
46
|
-
exports.getAuthorsMap = getAuthorsMap;
|
|
47
47
|
function normalizeImageUrl({ imageURL, baseUrl, }) {
|
|
48
48
|
return imageURL?.startsWith('/')
|
|
49
49
|
? (0, utils_1.normalizeUrl)([baseUrl, imageURL])
|
|
@@ -134,4 +134,3 @@ Don't mix 'authors' with other existing 'author_*' front matter. Choose one or t
|
|
|
134
134
|
}
|
|
135
135
|
return updatedAuthors;
|
|
136
136
|
}
|
|
137
|
-
exports.getBlogPostAuthors = getBlogPostAuthors;
|
package/lib/blogUtils.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { LoadContext } from '@docusaurus/types';
|
|
9
8
|
import type { PluginOptions, BlogPost, BlogTags, BlogPaginated } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
import type { BlogContentPaths } from './types';
|
package/lib/blogUtils.js
CHANGED
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.truncate = truncate;
|
|
10
|
+
exports.paginateBlogPosts = paginateBlogPosts;
|
|
11
|
+
exports.shouldBeListed = shouldBeListed;
|
|
12
|
+
exports.getBlogTags = getBlogTags;
|
|
13
|
+
exports.parseBlogFileName = parseBlogFileName;
|
|
14
|
+
exports.generateBlogPosts = generateBlogPosts;
|
|
15
|
+
exports.applyProcessBlogPosts = applyProcessBlogPosts;
|
|
10
16
|
const tslib_1 = require("tslib");
|
|
11
17
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
18
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
@@ -20,7 +26,6 @@ const authors_1 = require("./authors");
|
|
|
20
26
|
function truncate(fileString, truncateMarker) {
|
|
21
27
|
return fileString.split(truncateMarker, 1).shift();
|
|
22
28
|
}
|
|
23
|
-
exports.truncate = truncate;
|
|
24
29
|
function paginateBlogPosts({ blogPosts, basePageUrl, blogTitle, blogDescription, postsPerPageOption, pageBasePath, }) {
|
|
25
30
|
const totalCount = blogPosts.length;
|
|
26
31
|
const postsPerPage = postsPerPageOption === 'ALL' ? totalCount : postsPerPageOption;
|
|
@@ -51,11 +56,9 @@ function paginateBlogPosts({ blogPosts, basePageUrl, blogTitle, blogDescription,
|
|
|
51
56
|
}
|
|
52
57
|
return pages;
|
|
53
58
|
}
|
|
54
|
-
exports.paginateBlogPosts = paginateBlogPosts;
|
|
55
59
|
function shouldBeListed(blogPost) {
|
|
56
60
|
return !blogPost.metadata.unlisted;
|
|
57
61
|
}
|
|
58
|
-
exports.shouldBeListed = shouldBeListed;
|
|
59
62
|
function getBlogTags({ blogPosts, ...params }) {
|
|
60
63
|
const groups = (0, utils_1.groupTaggedItems)(blogPosts, (blogPost) => blogPost.metadata.tags);
|
|
61
64
|
return lodash_1.default.mapValues(groups, ({ tag, items: tagBlogPosts }) => {
|
|
@@ -78,7 +81,6 @@ function getBlogTags({ blogPosts, ...params }) {
|
|
|
78
81
|
};
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
exports.getBlogTags = getBlogTags;
|
|
82
84
|
const DATE_FILENAME_REGEX = /^(?<folder>.*)(?<date>\d{4}[-/]\d{1,2}[-/]\d{1,2})[-/]?(?<text>.*?)(?:\/index)?.mdx?$/;
|
|
83
85
|
function parseBlogFileName(blogSourceRelative) {
|
|
84
86
|
const dateFilenameMatch = blogSourceRelative.match(DATE_FILENAME_REGEX);
|
|
@@ -94,7 +96,6 @@ function parseBlogFileName(blogSourceRelative) {
|
|
|
94
96
|
const slug = `/${text}`;
|
|
95
97
|
return { date: undefined, text, slug };
|
|
96
98
|
}
|
|
97
|
-
exports.parseBlogFileName = parseBlogFileName;
|
|
98
99
|
async function parseBlogPostMarkdownFile({ filePath, parseFrontMatter, }) {
|
|
99
100
|
const fileContent = await fs_extra_1.default.readFile(filePath, 'utf-8');
|
|
100
101
|
try {
|
|
@@ -258,7 +259,6 @@ async function generateBlogPosts(contentPaths, context, options) {
|
|
|
258
259
|
}
|
|
259
260
|
return blogPosts;
|
|
260
261
|
}
|
|
261
|
-
exports.generateBlogPosts = generateBlogPosts;
|
|
262
262
|
async function applyProcessBlogPosts({ blogPosts, processBlogPosts, }) {
|
|
263
263
|
const processedBlogPosts = await processBlogPosts({ blogPosts });
|
|
264
264
|
if (Array.isArray(processedBlogPosts)) {
|
|
@@ -266,4 +266,3 @@ async function applyProcessBlogPosts({ blogPosts, processBlogPosts, }) {
|
|
|
266
266
|
}
|
|
267
267
|
return blogPosts;
|
|
268
268
|
}
|
|
269
|
-
exports.applyProcessBlogPosts = applyProcessBlogPosts;
|
package/lib/client/index.d.ts
CHANGED
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { BlogMetadata } from '@docusaurus/plugin-content-blog';
|
|
9
8
|
export declare function useBlogMetadata(): BlogMetadata;
|
package/lib/feed.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { DocusaurusConfig, HtmlTags, LoadContext } from '@docusaurus/types';
|
|
9
8
|
import type { PluginOptions, BlogPost } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
export declare function createBlogFeedFiles({ blogPosts: allBlogPosts, options, siteConfig, outDir, locale, }: {
|
package/lib/feed.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.createBlogFeedFiles = createBlogFeedFiles;
|
|
10
|
+
exports.createFeedHtmlHeadTags = createFeedHtmlHeadTags;
|
|
10
11
|
const tslib_1 = require("tslib");
|
|
11
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
13
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
@@ -150,7 +151,6 @@ async function createBlogFeedFiles({ blogPosts: allBlogPosts, options, siteConfi
|
|
|
150
151
|
generatePath: path_1.default.join(outDir, options.routeBasePath),
|
|
151
152
|
})));
|
|
152
153
|
}
|
|
153
|
-
exports.createBlogFeedFiles = createBlogFeedFiles;
|
|
154
154
|
function createFeedHtmlHeadTags({ context, options, }) {
|
|
155
155
|
const feedTypes = options.feedOptions.type;
|
|
156
156
|
if (!feedTypes) {
|
|
@@ -193,4 +193,3 @@ function createFeedHtmlHeadTags({ context, options, }) {
|
|
|
193
193
|
});
|
|
194
194
|
return headTags;
|
|
195
195
|
}
|
|
196
|
-
exports.createFeedHtmlHeadTags = createFeedHtmlHeadTags;
|
package/lib/frontMatter.d.ts
CHANGED
package/lib/frontMatter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateBlogPostFrontMatter =
|
|
3
|
+
exports.validateBlogPostFrontMatter = validateBlogPostFrontMatter;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -61,4 +61,3 @@ const BlogFrontMatterSchema = utils_validation_1.JoiFrontMatter.object({
|
|
|
61
61
|
function validateBlogPostFrontMatter(frontMatter) {
|
|
62
62
|
return (0, utils_validation_1.validateFrontMatter)(frontMatter, BlogFrontMatterSchema);
|
|
63
63
|
}
|
|
64
|
-
exports.validateBlogPostFrontMatter = validateBlogPostFrontMatter;
|
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
9
8
|
import type { PluginOptions, BlogContent } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
export default function pluginContentBlog(context: LoadContext, options: PluginOptions): Promise<Plugin<BlogContent>>;
|
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.validateOptions = void 0;
|
|
10
|
+
exports.default = pluginContentBlog;
|
|
10
11
|
const tslib_1 = require("tslib");
|
|
11
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
13
|
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
@@ -161,13 +162,14 @@ async function pluginContentBlog(context, options) {
|
|
|
161
162
|
return (0, translations_1.translateContent)(content, translationFiles);
|
|
162
163
|
},
|
|
163
164
|
configureWebpack() {
|
|
164
|
-
const { admonitions, rehypePlugins, remarkPlugins, truncateMarker, beforeDefaultRemarkPlugins, beforeDefaultRehypePlugins, } = options;
|
|
165
|
+
const { admonitions, rehypePlugins, remarkPlugins, recmaPlugins, truncateMarker, beforeDefaultRemarkPlugins, beforeDefaultRehypePlugins, } = options;
|
|
165
166
|
const contentDirs = (0, utils_1.getContentPathList)(contentPaths);
|
|
166
167
|
function createMDXLoader() {
|
|
167
168
|
const loaderOptions = {
|
|
168
169
|
admonitions,
|
|
169
170
|
remarkPlugins,
|
|
170
171
|
rehypePlugins,
|
|
172
|
+
recmaPlugins,
|
|
171
173
|
beforeDefaultRemarkPlugins: [
|
|
172
174
|
footnoteIDFixer_1.default,
|
|
173
175
|
...beforeDefaultRemarkPlugins,
|
|
@@ -263,6 +265,5 @@ async function pluginContentBlog(context, options) {
|
|
|
263
265
|
},
|
|
264
266
|
};
|
|
265
267
|
}
|
|
266
|
-
exports.default = pluginContentBlog;
|
|
267
268
|
var options_1 = require("./options");
|
|
268
269
|
Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return options_1.validateOptions; } });
|
package/lib/markdownLoader.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = markdownLoader;
|
|
9
10
|
const blogUtils_1 = require("./blogUtils");
|
|
10
11
|
function markdownLoader(source) {
|
|
11
12
|
const fileString = source;
|
|
@@ -23,4 +24,3 @@ function markdownLoader(source) {
|
|
|
23
24
|
}
|
|
24
25
|
return callback(null, finalContent);
|
|
25
26
|
}
|
|
26
|
-
exports.default = markdownLoader;
|
package/lib/options.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { PluginOptions, Options } from '@docusaurus/plugin-content-blog';
|
|
9
8
|
import type { OptionValidationContext } from '@docusaurus/types';
|
|
10
9
|
export declare const DEFAULT_OPTIONS: PluginOptions;
|
package/lib/options.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.DEFAULT_OPTIONS = void 0;
|
|
10
|
+
exports.validateOptions = validateOptions;
|
|
10
11
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
11
12
|
const utils_1 = require("@docusaurus/utils");
|
|
12
13
|
exports.DEFAULT_OPTIONS = {
|
|
@@ -17,6 +18,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
17
18
|
truncateMarker: /<!--\s*truncate\s*-->|\{\/\*\s*truncate\s*\*\/\}/,
|
|
18
19
|
rehypePlugins: [],
|
|
19
20
|
remarkPlugins: [],
|
|
21
|
+
recmaPlugins: [],
|
|
20
22
|
showReadingTime: true,
|
|
21
23
|
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
|
22
24
|
blogTagsListComponent: '@theme/BlogTagsListPage',
|
|
@@ -74,6 +76,7 @@ const PluginOptionSchema = utils_validation_1.Joi.object({
|
|
|
74
76
|
showReadingTime: utils_validation_1.Joi.bool().default(exports.DEFAULT_OPTIONS.showReadingTime),
|
|
75
77
|
remarkPlugins: utils_validation_1.RemarkPluginsSchema.default(exports.DEFAULT_OPTIONS.remarkPlugins),
|
|
76
78
|
rehypePlugins: utils_validation_1.RehypePluginsSchema.default(exports.DEFAULT_OPTIONS.rehypePlugins),
|
|
79
|
+
recmaPlugins: utils_validation_1.RecmaPluginsSchema.default(exports.DEFAULT_OPTIONS.recmaPlugins),
|
|
77
80
|
admonitions: utils_validation_1.AdmonitionsSchema.default(exports.DEFAULT_OPTIONS.admonitions),
|
|
78
81
|
editUrl: utils_validation_1.Joi.alternatives().try(utils_validation_1.URISchema, utils_validation_1.Joi.function()),
|
|
79
82
|
editLocalizedFiles: utils_validation_1.Joi.boolean().default(exports.DEFAULT_OPTIONS.editLocalizedFiles),
|
|
@@ -125,4 +128,3 @@ function validateOptions({ validate, options, }) {
|
|
|
125
128
|
const validatedOptions = validate(PluginOptionSchema, options);
|
|
126
129
|
return validatedOptions;
|
|
127
130
|
}
|
|
128
|
-
exports.validateOptions = validateOptions;
|
package/lib/props.d.ts
CHANGED
package/lib/props.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toTagsProp = toTagsProp;
|
|
4
|
+
exports.toTagProp = toTagProp;
|
|
4
5
|
function toTagsProp({ blogTags }) {
|
|
5
6
|
return Object.values(blogTags)
|
|
6
7
|
.filter((tag) => !tag.unlisted)
|
|
@@ -11,7 +12,6 @@ function toTagsProp({ blogTags }) {
|
|
|
11
12
|
count: tag.items.length,
|
|
12
13
|
}));
|
|
13
14
|
}
|
|
14
|
-
exports.toTagsProp = toTagsProp;
|
|
15
15
|
function toTagProp({ blogTagsListPath, tag, }) {
|
|
16
16
|
return {
|
|
17
17
|
label: tag.label,
|
|
@@ -22,4 +22,3 @@ function toTagProp({ blogTagsListPath, tag, }) {
|
|
|
22
22
|
unlisted: tag.unlisted,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.toTagProp = toTagProp;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = plugin;
|
|
9
10
|
const utils_1 = require("@docusaurus/utils");
|
|
10
11
|
/**
|
|
11
12
|
* In the blog list view, each post will be compiled separately. However, they
|
|
@@ -25,4 +26,3 @@ function plugin() {
|
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
exports.default = plugin;
|
package/lib/routes.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { PluginContentLoadedActions, RouteConfig } from '@docusaurus/types';
|
|
9
8
|
import type { BlogContent, PluginOptions } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
type CreateAllRoutesParam = {
|
package/lib/routes.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.createAllRoutes = createAllRoutes;
|
|
10
|
+
exports.buildAllRoutes = buildAllRoutes;
|
|
10
11
|
const tslib_1 = require("tslib");
|
|
11
12
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
12
13
|
const utils_1 = require("@docusaurus/utils");
|
|
@@ -16,7 +17,6 @@ async function createAllRoutes(param) {
|
|
|
16
17
|
const routes = await buildAllRoutes(param);
|
|
17
18
|
routes.forEach(param.actions.addRoute);
|
|
18
19
|
}
|
|
19
|
-
exports.createAllRoutes = createAllRoutes;
|
|
20
20
|
async function buildAllRoutes({ baseUrl, content, actions, options, aliasedSource, }) {
|
|
21
21
|
const { blogListComponent, blogPostComponent, blogTagsListComponent, blogTagsPostsComponent, blogArchiveComponent, routeBasePath, archiveBasePath, blogTitle, } = options;
|
|
22
22
|
const pluginId = options.id;
|
|
@@ -179,4 +179,3 @@ async function buildAllRoutes({ baseUrl, content, actions, options, aliasedSourc
|
|
|
179
179
|
...createArchiveRoute(),
|
|
180
180
|
];
|
|
181
181
|
}
|
|
182
|
-
exports.buildAllRoutes = buildAllRoutes;
|
package/lib/translations.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference path="../src/plugin-content-blog.d.ts" />
|
|
8
7
|
import type { TranslationFile } from '@docusaurus/types';
|
|
9
8
|
import type { PluginOptions, BlogContent } from '@docusaurus/plugin-content-blog';
|
|
10
9
|
export declare function getTranslationFiles(options: PluginOptions): TranslationFile[];
|
package/lib/translations.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.getTranslationFiles = getTranslationFiles;
|
|
10
|
+
exports.translateContent = translateContent;
|
|
10
11
|
function translateListPage(blogListPaginated, translations) {
|
|
11
12
|
return blogListPaginated.map((page) => {
|
|
12
13
|
const { items, metadata } = page;
|
|
@@ -41,7 +42,6 @@ function getTranslationFiles(options) {
|
|
|
41
42
|
},
|
|
42
43
|
];
|
|
43
44
|
}
|
|
44
|
-
exports.getTranslationFiles = getTranslationFiles;
|
|
45
45
|
function translateContent(content, translationFiles) {
|
|
46
46
|
const { content: optionsTranslations } = translationFiles[0];
|
|
47
47
|
return {
|
|
@@ -50,4 +50,3 @@ function translateContent(content, translationFiles) {
|
|
|
50
50
|
blogListPaginated: translateListPage(content.blogListPaginated, optionsTranslations),
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
exports.translateContent = translateContent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5983",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@docusaurus/core": "0.0.0-
|
|
35
|
-
"@docusaurus/logger": "0.0.0-
|
|
36
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
37
|
-
"@docusaurus/types": "0.0.0-
|
|
38
|
-
"@docusaurus/utils": "0.0.0-
|
|
39
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
40
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
34
|
+
"@docusaurus/core": "0.0.0-5983",
|
|
35
|
+
"@docusaurus/logger": "0.0.0-5983",
|
|
36
|
+
"@docusaurus/mdx-loader": "0.0.0-5983",
|
|
37
|
+
"@docusaurus/types": "0.0.0-5983",
|
|
38
|
+
"@docusaurus/utils": "0.0.0-5983",
|
|
39
|
+
"@docusaurus/utils-common": "0.0.0-5983",
|
|
40
|
+
"@docusaurus/utils-validation": "0.0.0-5983",
|
|
41
41
|
"cheerio": "^1.0.0-rc.12",
|
|
42
42
|
"feed": "^4.2.2",
|
|
43
43
|
"fs-extra": "^11.1.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@total-typescript/shoehorn": "^0.1.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "303ced3b8c9e4b7674a42ebbbe73d24debeb211a"
|
|
63
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -250,6 +250,7 @@ export default async function pluginContentBlog(
|
|
|
250
250
|
admonitions,
|
|
251
251
|
rehypePlugins,
|
|
252
252
|
remarkPlugins,
|
|
253
|
+
recmaPlugins,
|
|
253
254
|
truncateMarker,
|
|
254
255
|
beforeDefaultRemarkPlugins,
|
|
255
256
|
beforeDefaultRehypePlugins,
|
|
@@ -262,6 +263,7 @@ export default async function pluginContentBlog(
|
|
|
262
263
|
admonitions,
|
|
263
264
|
remarkPlugins,
|
|
264
265
|
rehypePlugins,
|
|
266
|
+
recmaPlugins,
|
|
265
267
|
beforeDefaultRemarkPlugins: [
|
|
266
268
|
footnoteIDFixer,
|
|
267
269
|
...beforeDefaultRemarkPlugins,
|
package/src/options.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Joi,
|
|
10
10
|
RemarkPluginsSchema,
|
|
11
11
|
RehypePluginsSchema,
|
|
12
|
+
RecmaPluginsSchema,
|
|
12
13
|
AdmonitionsSchema,
|
|
13
14
|
RouteBasePathSchema,
|
|
14
15
|
URISchema,
|
|
@@ -29,6 +30,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|
|
29
30
|
truncateMarker: /<!--\s*truncate\s*-->|\{\/\*\s*truncate\s*\*\/\}/,
|
|
30
31
|
rehypePlugins: [],
|
|
31
32
|
remarkPlugins: [],
|
|
33
|
+
recmaPlugins: [],
|
|
32
34
|
showReadingTime: true,
|
|
33
35
|
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
|
34
36
|
blogTagsListComponent: '@theme/BlogTagsListPage',
|
|
@@ -93,6 +95,7 @@ const PluginOptionSchema = Joi.object<PluginOptions>({
|
|
|
93
95
|
showReadingTime: Joi.bool().default(DEFAULT_OPTIONS.showReadingTime),
|
|
94
96
|
remarkPlugins: RemarkPluginsSchema.default(DEFAULT_OPTIONS.remarkPlugins),
|
|
95
97
|
rehypePlugins: RehypePluginsSchema.default(DEFAULT_OPTIONS.rehypePlugins),
|
|
98
|
+
recmaPlugins: RecmaPluginsSchema.default(DEFAULT_OPTIONS.recmaPlugins),
|
|
96
99
|
admonitions: AdmonitionsSchema.default(DEFAULT_OPTIONS.admonitions),
|
|
97
100
|
editUrl: Joi.alternatives().try(URISchema, Joi.function()),
|
|
98
101
|
editLocalizedFiles: Joi.boolean().default(DEFAULT_OPTIONS.editLocalizedFiles),
|