@docusaurus/plugin-content-blog 0.0.0-5979 → 0.0.0-5982

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 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.getBlogPostAuthors = exports.getAuthorsMap = exports.validateAuthorsMap = void 0;
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;
@@ -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.applyProcessBlogPosts = exports.generateBlogPosts = exports.parseBlogFileName = exports.getBlogTags = exports.shouldBeListed = exports.paginateBlogPosts = exports.truncate = void 0;
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;
@@ -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.createFeedHtmlHeadTags = exports.createBlogFeedFiles = void 0;
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;
@@ -1,4 +1,3 @@
1
- /// <reference path="../src/plugin-content-blog.d.ts" />
2
1
  import type { BlogPostFrontMatter } from '@docusaurus/plugin-content-blog';
3
2
  export declare function validateBlogPostFrontMatter(frontMatter: {
4
3
  [key: string]: unknown;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateBlogPostFrontMatter = void 0;
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"));
@@ -263,6 +264,5 @@ async function pluginContentBlog(context, options) {
263
264
  },
264
265
  };
265
266
  }
266
- exports.default = pluginContentBlog;
267
267
  var options_1 = require("./options");
268
268
  Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return options_1.validateOptions; } });
@@ -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.validateOptions = exports.DEFAULT_OPTIONS = void 0;
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 = {
@@ -125,4 +126,3 @@ function validateOptions({ validate, options, }) {
125
126
  const validatedOptions = validate(PluginOptionSchema, options);
126
127
  return validatedOptions;
127
128
  }
128
- exports.validateOptions = validateOptions;
package/lib/props.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference path="../src/plugin-content-blog.d.ts" />
2
1
  /**
3
2
  * Copyright (c) Facebook, Inc. and its affiliates.
4
3
  *
package/lib/props.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toTagProp = exports.toTagsProp = void 0;
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.buildAllRoutes = exports.createAllRoutes = void 0;
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;
@@ -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[];
@@ -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.translateContent = exports.getTranslationFiles = void 0;
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-5979",
3
+ "version": "0.0.0-5982",
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-5979",
35
- "@docusaurus/logger": "0.0.0-5979",
36
- "@docusaurus/mdx-loader": "0.0.0-5979",
37
- "@docusaurus/types": "0.0.0-5979",
38
- "@docusaurus/utils": "0.0.0-5979",
39
- "@docusaurus/utils-common": "0.0.0-5979",
40
- "@docusaurus/utils-validation": "0.0.0-5979",
34
+ "@docusaurus/core": "0.0.0-5982",
35
+ "@docusaurus/logger": "0.0.0-5982",
36
+ "@docusaurus/mdx-loader": "0.0.0-5982",
37
+ "@docusaurus/types": "0.0.0-5982",
38
+ "@docusaurus/utils": "0.0.0-5982",
39
+ "@docusaurus/utils-common": "0.0.0-5982",
40
+ "@docusaurus/utils-validation": "0.0.0-5982",
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": "8a074c94e2204f208e95bd83371a2fbe526ad511"
62
+ "gitHead": "8b6a944282857a6fc8e184e8b56109238ce50924"
63
63
  }