@docusaurus/plugin-content-blog 0.0.0-4452 → 0.0.0-4458

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 CHANGED
@@ -10,12 +10,13 @@ exports.getBlogPostAuthors = exports.getAuthorsMap = exports.validateAuthorsMap
10
10
  const utils_1 = require("@docusaurus/utils");
11
11
  const utils_validation_1 = require("@docusaurus/utils-validation");
12
12
  const AuthorsMapSchema = utils_validation_1.Joi.object().pattern(utils_validation_1.Joi.string(), utils_validation_1.Joi.object({
13
- name: utils_validation_1.Joi.string().required(),
13
+ name: utils_validation_1.Joi.string(),
14
14
  url: utils_validation_1.URISchema,
15
15
  imageURL: utils_validation_1.URISchema,
16
16
  title: utils_validation_1.Joi.string(),
17
17
  })
18
18
  .rename('image_url', 'imageURL')
19
+ .or('name', 'imageURL')
19
20
  .unknown()
20
21
  .required());
21
22
  function validateAuthorsMap(content) {
@@ -38,7 +39,6 @@ function getFrontMatterAuthorLegacy(frontMatter) {
38
39
  const title = (_a = frontMatter.author_title) !== null && _a !== void 0 ? _a : frontMatter.authorTitle;
39
40
  const url = (_b = frontMatter.author_url) !== null && _b !== void 0 ? _b : frontMatter.authorURL;
40
41
  const imageURL = (_c = frontMatter.author_image_url) !== null && _c !== void 0 ? _c : frontMatter.authorImageURL;
41
- // Shouldn't we require at least an author name?
42
42
  if (name || title || url || imageURL) {
43
43
  return {
44
44
  name,
@@ -15,7 +15,7 @@ const BlogPostFrontMatterAuthorSchema = utils_validation_1.JoiFrontMatter.object
15
15
  url: utils_validation_1.URISchema,
16
16
  imageURL: utils_validation_1.JoiFrontMatter.string(),
17
17
  })
18
- .or('key', 'name')
18
+ .or('key', 'name', 'imageURL')
19
19
  .rename('image_url', 'imageURL', { alias: true });
20
20
  const FrontMatterAuthorErrorMessage = '{{#label}} does not look like a valid blog post author. Please use an author key or an author object (with a key and/or name).';
21
21
  const BlogFrontMatterSchema = utils_validation_1.JoiFrontMatter.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-blog",
3
- "version": "0.0.0-4452",
3
+ "version": "0.0.0-4458",
4
4
  "description": "Blog plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-blog.d.ts",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "0.0.0-4452",
22
- "@docusaurus/logger": "0.0.0-4452",
23
- "@docusaurus/mdx-loader": "0.0.0-4452",
24
- "@docusaurus/utils": "0.0.0-4452",
25
- "@docusaurus/utils-validation": "0.0.0-4452",
21
+ "@docusaurus/core": "0.0.0-4458",
22
+ "@docusaurus/logger": "0.0.0-4458",
23
+ "@docusaurus/mdx-loader": "0.0.0-4458",
24
+ "@docusaurus/utils": "0.0.0-4458",
25
+ "@docusaurus/utils-validation": "0.0.0-4458",
26
26
  "escape-string-regexp": "^4.0.0",
27
27
  "feed": "^4.2.2",
28
28
  "fs-extra": "^10.0.0",
@@ -36,7 +36,7 @@
36
36
  "webpack": "^5.61.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@docusaurus/types": "0.0.0-4452"
39
+ "@docusaurus/types": "0.0.0-4458"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": "^16.8.4 || ^17.0.0",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=14"
47
47
  },
48
- "gitHead": "48cae5712e0a40d5f7e5c2669edcf2de8ae2533f"
48
+ "gitHead": "38e7bfd3584608cf9d5b3c3d15f431efe755cd28"
49
49
  }
package/src/authors.ts CHANGED
@@ -20,12 +20,13 @@ export type AuthorsMap = Record<string, Author>;
20
20
  const AuthorsMapSchema = Joi.object<AuthorsMap>().pattern(
21
21
  Joi.string(),
22
22
  Joi.object({
23
- name: Joi.string().required(),
23
+ name: Joi.string(),
24
24
  url: URISchema,
25
25
  imageURL: URISchema,
26
26
  title: Joi.string(),
27
27
  })
28
28
  .rename('image_url', 'imageURL')
29
+ .or('name', 'imageURL')
29
30
  .unknown()
30
31
  .required(),
31
32
  );
@@ -63,7 +64,6 @@ function getFrontMatterAuthorLegacy(
63
64
  const url = frontMatter.author_url ?? frontMatter.authorURL;
64
65
  const imageURL = frontMatter.author_image_url ?? frontMatter.authorImageURL;
65
66
 
66
- // Shouldn't we require at least an author name?
67
67
  if (name || title || url || imageURL) {
68
68
  return {
69
69
  name,
@@ -21,7 +21,7 @@ const BlogPostFrontMatterAuthorSchema = Joi.object({
21
21
  url: URISchema,
22
22
  imageURL: Joi.string(),
23
23
  })
24
- .or('key', 'name')
24
+ .or('key', 'name', 'imageURL')
25
25
  .rename('image_url', 'imageURL', {alias: true});
26
26
 
27
27
  const FrontMatterAuthorErrorMessage =