@docusaurus/plugin-content-blog 0.0.0-5089 → 0.0.0-5093

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/index.js CHANGED
@@ -10,24 +10,17 @@ exports.validateOptions = void 0;
10
10
  const tslib_1 = require("tslib");
11
11
  const path_1 = tslib_1.__importDefault(require("path"));
12
12
  const utils_1 = require("@docusaurus/utils");
13
- const remark_admonitions_1 = tslib_1.__importDefault(require("remark-admonitions"));
14
13
  const blogUtils_1 = require("./blogUtils");
15
14
  const footnoteIDFixer_1 = tslib_1.__importDefault(require("./remark/footnoteIDFixer"));
16
15
  const translations_1 = require("./translations");
17
16
  const feed_1 = require("./feed");
18
17
  async function pluginContentBlog(context, options) {
19
- if (options.admonitions) {
20
- options.remarkPlugins = options.remarkPlugins.concat([
21
- [remark_admonitions_1.default, options.admonitions],
22
- ]);
23
- }
24
- const { siteDir, siteConfig, generatedFilesDir, i18n: { currentLocale }, } = context;
18
+ const { siteDir, siteConfig, generatedFilesDir, localizationDir, i18n: { currentLocale }, } = context;
25
19
  const { onBrokenMarkdownLinks, baseUrl } = siteConfig;
26
20
  const contentPaths = {
27
21
  contentPath: path_1.default.resolve(siteDir, options.path),
28
22
  contentPathLocalized: (0, utils_1.getPluginI18nPath)({
29
- siteDir,
30
- locale: currentLocale,
23
+ localizationDir,
31
24
  pluginName: 'docusaurus-plugin-content-blog',
32
25
  pluginId: options.id,
33
26
  }),
@@ -245,7 +238,7 @@ async function pluginContentBlog(context, options) {
245
238
  return (0, translations_1.translateContent)(content, translationFiles);
246
239
  },
247
240
  configureWebpack(_config, isServer, { getJSLoader }, content) {
248
- const { rehypePlugins, remarkPlugins, truncateMarker, beforeDefaultRemarkPlugins, beforeDefaultRehypePlugins, } = options;
241
+ const { admonitions, rehypePlugins, remarkPlugins, truncateMarker, beforeDefaultRemarkPlugins, beforeDefaultRehypePlugins, } = options;
249
242
  const markdownLoaderOptions = {
250
243
  siteDir,
251
244
  contentPaths,
@@ -277,6 +270,7 @@ async function pluginContentBlog(context, options) {
277
270
  {
278
271
  loader: require.resolve('@docusaurus/mdx-loader'),
279
272
  options: {
273
+ admonitions,
280
274
  remarkPlugins,
281
275
  rehypePlugins,
282
276
  beforeDefaultRemarkPlugins: [
package/lib/options.js CHANGED
@@ -13,7 +13,7 @@ exports.DEFAULT_OPTIONS = {
13
13
  feedOptions: { type: ['rss', 'atom'], copyright: '' },
14
14
  beforeDefaultRehypePlugins: [],
15
15
  beforeDefaultRemarkPlugins: [],
16
- admonitions: {},
16
+ admonitions: true,
17
17
  truncateMarker: /<!--\s*truncate\s*-->/,
18
18
  rehypePlugins: [],
19
19
  remarkPlugins: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-blog",
3
- "version": "0.0.0-5089",
3
+ "version": "0.0.0-5093",
4
4
  "description": "Blog plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-blog.d.ts",
@@ -18,19 +18,18 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "0.0.0-5089",
22
- "@docusaurus/logger": "0.0.0-5089",
23
- "@docusaurus/mdx-loader": "0.0.0-5089",
24
- "@docusaurus/types": "0.0.0-5089",
25
- "@docusaurus/utils": "0.0.0-5089",
26
- "@docusaurus/utils-common": "0.0.0-5089",
27
- "@docusaurus/utils-validation": "0.0.0-5089",
21
+ "@docusaurus/core": "0.0.0-5093",
22
+ "@docusaurus/logger": "0.0.0-5093",
23
+ "@docusaurus/mdx-loader": "0.0.0-5093",
24
+ "@docusaurus/types": "0.0.0-5093",
25
+ "@docusaurus/utils": "0.0.0-5093",
26
+ "@docusaurus/utils-common": "0.0.0-5093",
27
+ "@docusaurus/utils-validation": "0.0.0-5093",
28
28
  "cheerio": "^1.0.0-rc.11",
29
29
  "feed": "^4.2.2",
30
30
  "fs-extra": "^10.1.0",
31
31
  "lodash": "^4.17.21",
32
32
  "reading-time": "^1.5.0",
33
- "remark-admonitions": "^1.2.1",
34
33
  "tslib": "^2.4.0",
35
34
  "unist-util-visit": "^2.0.3",
36
35
  "utility-types": "^3.10.0",
@@ -47,5 +46,5 @@
47
46
  "engines": {
48
47
  "node": ">=16.14"
49
48
  },
50
- "gitHead": "f03215790788b609224a7d79e123fdfb3ecdb717"
49
+ "gitHead": "2aa3114f2c53ba37b785f22ac723059c7a4a75be"
51
50
  }
package/src/index.ts CHANGED
@@ -21,7 +21,6 @@ import {
21
21
  type TagsListItem,
22
22
  type TagModule,
23
23
  } from '@docusaurus/utils';
24
- import admonitions from 'remark-admonitions';
25
24
  import {
26
25
  generateBlogPosts,
27
26
  getSourceToPermalink,
@@ -49,16 +48,11 @@ export default async function pluginContentBlog(
49
48
  context: LoadContext,
50
49
  options: PluginOptions,
51
50
  ): Promise<Plugin<BlogContent>> {
52
- if (options.admonitions) {
53
- options.remarkPlugins = options.remarkPlugins.concat([
54
- [admonitions, options.admonitions],
55
- ]);
56
- }
57
-
58
51
  const {
59
52
  siteDir,
60
53
  siteConfig,
61
54
  generatedFilesDir,
55
+ localizationDir,
62
56
  i18n: {currentLocale},
63
57
  } = context;
64
58
  const {onBrokenMarkdownLinks, baseUrl} = siteConfig;
@@ -66,8 +60,7 @@ export default async function pluginContentBlog(
66
60
  const contentPaths: BlogContentPaths = {
67
61
  contentPath: path.resolve(siteDir, options.path),
68
62
  contentPathLocalized: getPluginI18nPath({
69
- siteDir,
70
- locale: currentLocale,
63
+ localizationDir,
71
64
  pluginName: 'docusaurus-plugin-content-blog',
72
65
  pluginId: options.id,
73
66
  }),
@@ -381,6 +374,7 @@ export default async function pluginContentBlog(
381
374
 
382
375
  configureWebpack(_config, isServer, {getJSLoader}, content) {
383
376
  const {
377
+ admonitions,
384
378
  rehypePlugins,
385
379
  remarkPlugins,
386
380
  truncateMarker,
@@ -423,6 +417,7 @@ export default async function pluginContentBlog(
423
417
  {
424
418
  loader: require.resolve('@docusaurus/mdx-loader'),
425
419
  options: {
420
+ admonitions,
426
421
  remarkPlugins,
427
422
  rehypePlugins,
428
423
  beforeDefaultRemarkPlugins: [
package/src/options.ts CHANGED
@@ -24,7 +24,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
24
24
  feedOptions: {type: ['rss', 'atom'], copyright: ''},
25
25
  beforeDefaultRehypePlugins: [],
26
26
  beforeDefaultRemarkPlugins: [],
27
- admonitions: {},
27
+ admonitions: true,
28
28
  truncateMarker: /<!--\s*truncate\s*-->/,
29
29
  rehypePlugins: [],
30
30
  remarkPlugins: [],
@@ -377,7 +377,6 @@ declare module '@docusaurus/plugin-content-blog' {
377
377
  * unlocalized file. Ignored when `editUrl` is a function.
378
378
  */
379
379
  editLocalizedFiles?: boolean;
380
- admonitions: {[key: string]: unknown};
381
380
  /** Path to the authors map file, relative to the blog content directory. */
382
381
  authorsMapPath: string;
383
382
  /** A callback to customize the reading time number displayed. */
package/src/deps.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- declare module 'remark-admonitions' {
9
- type Options = {[key: string]: unknown};
10
-
11
- const plugin: (options?: Options) => void;
12
- export = plugin;
13
- }