@docusaurus/plugin-content-blog 0.0.0-4716 → 0.0.0-4721
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.js +10 -2
- package/package.json +9 -9
- package/src/authors.ts +25 -14
package/lib/authors.js
CHANGED
|
@@ -9,7 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.getBlogPostAuthors = exports.getAuthorsMap = exports.validateAuthorsMap = void 0;
|
|
10
10
|
const utils_1 = require("@docusaurus/utils");
|
|
11
11
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
12
|
-
const AuthorsMapSchema = utils_validation_1.Joi.object()
|
|
12
|
+
const AuthorsMapSchema = utils_validation_1.Joi.object()
|
|
13
|
+
.pattern(utils_validation_1.Joi.string(), utils_validation_1.Joi.object({
|
|
13
14
|
name: utils_validation_1.Joi.string(),
|
|
14
15
|
url: utils_validation_1.URISchema,
|
|
15
16
|
imageURL: utils_validation_1.URISchema,
|
|
@@ -19,7 +20,14 @@ const AuthorsMapSchema = utils_validation_1.Joi.object().pattern(utils_validatio
|
|
|
19
20
|
.rename('image_url', 'imageURL')
|
|
20
21
|
.or('name', 'imageURL')
|
|
21
22
|
.unknown()
|
|
22
|
-
.required()
|
|
23
|
+
.required()
|
|
24
|
+
.messages({
|
|
25
|
+
'object.base': '{#label} should be an author object containing properties like name, title, and imageURL.',
|
|
26
|
+
'any.required': '{#label} cannot be undefined. It should be an author object containing properties like name, title, and imageURL.',
|
|
27
|
+
}))
|
|
28
|
+
.messages({
|
|
29
|
+
'object.base': "The authors map file should contain an object where each entry contains an author key and the corresponding author's data.",
|
|
30
|
+
});
|
|
23
31
|
function validateAuthorsMap(content) {
|
|
24
32
|
return utils_validation_1.Joi.attempt(content, AuthorsMapSchema);
|
|
25
33
|
}
|
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-4721",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/logger": "0.0.0-
|
|
23
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
24
|
-
"@docusaurus/utils": "0.0.0-
|
|
25
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
26
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-4721",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-4721",
|
|
23
|
+
"@docusaurus/mdx-loader": "0.0.0-4721",
|
|
24
|
+
"@docusaurus/utils": "0.0.0-4721",
|
|
25
|
+
"@docusaurus/utils-common": "0.0.0-4721",
|
|
26
|
+
"@docusaurus/utils-validation": "0.0.0-4721",
|
|
27
27
|
"cheerio": "^1.0.0-rc.10",
|
|
28
28
|
"feed": "^4.2.2",
|
|
29
29
|
"fs-extra": "^10.0.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"webpack": "^5.70.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@docusaurus/types": "0.0.0-
|
|
38
|
+
"@docusaurus/types": "0.0.0-4721",
|
|
39
39
|
"escape-string-regexp": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=14"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "e01ee5ebec6b6fd7e5084cc67014a555329cc336"
|
|
49
49
|
}
|
package/src/authors.ts
CHANGED
|
@@ -17,20 +17,31 @@ import type {
|
|
|
17
17
|
|
|
18
18
|
export type AuthorsMap = Record<string, Author>;
|
|
19
19
|
|
|
20
|
-
const AuthorsMapSchema = Joi.object<AuthorsMap>()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
20
|
+
const AuthorsMapSchema = Joi.object<AuthorsMap>()
|
|
21
|
+
.pattern(
|
|
22
|
+
Joi.string(),
|
|
23
|
+
Joi.object({
|
|
24
|
+
name: Joi.string(),
|
|
25
|
+
url: URISchema,
|
|
26
|
+
imageURL: URISchema,
|
|
27
|
+
title: Joi.string(),
|
|
28
|
+
email: Joi.string(),
|
|
29
|
+
})
|
|
30
|
+
.rename('image_url', 'imageURL')
|
|
31
|
+
.or('name', 'imageURL')
|
|
32
|
+
.unknown()
|
|
33
|
+
.required()
|
|
34
|
+
.messages({
|
|
35
|
+
'object.base':
|
|
36
|
+
'{#label} should be an author object containing properties like name, title, and imageURL.',
|
|
37
|
+
'any.required':
|
|
38
|
+
'{#label} cannot be undefined. It should be an author object containing properties like name, title, and imageURL.',
|
|
39
|
+
}),
|
|
40
|
+
)
|
|
41
|
+
.messages({
|
|
42
|
+
'object.base':
|
|
43
|
+
"The authors map file should contain an object where each entry contains an author key and the corresponding author's data.",
|
|
44
|
+
});
|
|
34
45
|
|
|
35
46
|
export function validateAuthorsMap(content: unknown): AuthorsMap {
|
|
36
47
|
return Joi.attempt(content, AuthorsMapSchema);
|