@docusaurus/plugin-content-blog 0.0.0-5711 → 0.0.0-5714

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
@@ -106,6 +106,7 @@ async function pluginContentBlog(context, options) {
106
106
  const { blogListComponent, blogPostComponent, blogTagsListComponent, blogTagsPostsComponent, blogArchiveComponent, routeBasePath, archiveBasePath, } = options;
107
107
  const { addRoute, createData } = actions;
108
108
  const { blogSidebarTitle, blogPosts, blogListPaginated, blogTags, blogTagsListPath, } = blogContents;
109
+ const listedBlogPosts = blogPosts.filter(blogUtils_1.shouldBeListed);
109
110
  const blogItemsToMetadata = {};
110
111
  const sidebarBlogPosts = options.blogSidebarCount === 'ALL'
111
112
  ? blogPosts
@@ -124,14 +125,14 @@ async function pluginContentBlog(context, options) {
124
125
  };
125
126
  });
126
127
  }
127
- if (archiveBasePath && blogPosts.length) {
128
+ if (archiveBasePath && listedBlogPosts.length) {
128
129
  const archiveUrl = (0, utils_1.normalizeUrl)([
129
130
  baseUrl,
130
131
  routeBasePath,
131
132
  archiveBasePath,
132
133
  ]);
133
134
  // Create a blog archive route
134
- const archiveProp = await createData(`${(0, utils_1.docuHash)(archiveUrl)}.json`, JSON.stringify({ blogPosts }, null, 2));
135
+ const archiveProp = await createData(`${(0, utils_1.docuHash)(archiveUrl)}.json`, JSON.stringify({ blogPosts: listedBlogPosts }, null, 2));
135
136
  addRoute({
136
137
  path: archiveUrl,
137
138
  component: blogArchiveComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-blog",
3
- "version": "0.0.0-5711",
3
+ "version": "0.0.0-5714",
4
4
  "description": "Blog plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-blog.d.ts",
@@ -19,13 +19,13 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@docusaurus/core": "0.0.0-5711",
23
- "@docusaurus/logger": "0.0.0-5711",
24
- "@docusaurus/mdx-loader": "0.0.0-5711",
25
- "@docusaurus/types": "0.0.0-5711",
26
- "@docusaurus/utils": "0.0.0-5711",
27
- "@docusaurus/utils-common": "0.0.0-5711",
28
- "@docusaurus/utils-validation": "0.0.0-5711",
22
+ "@docusaurus/core": "0.0.0-5714",
23
+ "@docusaurus/logger": "0.0.0-5714",
24
+ "@docusaurus/mdx-loader": "0.0.0-5714",
25
+ "@docusaurus/types": "0.0.0-5714",
26
+ "@docusaurus/utils": "0.0.0-5714",
27
+ "@docusaurus/utils-common": "0.0.0-5714",
28
+ "@docusaurus/utils-validation": "0.0.0-5714",
29
29
  "cheerio": "^1.0.0-rc.12",
30
30
  "feed": "^4.2.2",
31
31
  "fs-extra": "^11.1.1",
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=18.0"
46
46
  },
47
- "gitHead": "8004a0f626f601cf363d59088f336eb6a106e914"
47
+ "gitHead": "cf9d5d34dd17f7738dd7bcf9987023575e486118"
48
48
  }
package/src/index.ts CHANGED
@@ -191,6 +191,8 @@ export default async function pluginContentBlog(
191
191
  blogTagsListPath,
192
192
  } = blogContents;
193
193
 
194
+ const listedBlogPosts = blogPosts.filter(shouldBeListed);
195
+
194
196
  const blogItemsToMetadata: {[postId: string]: BlogPostMetadata} = {};
195
197
 
196
198
  const sidebarBlogPosts =
@@ -213,7 +215,7 @@ export default async function pluginContentBlog(
213
215
  });
214
216
  }
215
217
 
216
- if (archiveBasePath && blogPosts.length) {
218
+ if (archiveBasePath && listedBlogPosts.length) {
217
219
  const archiveUrl = normalizeUrl([
218
220
  baseUrl,
219
221
  routeBasePath,
@@ -222,7 +224,7 @@ export default async function pluginContentBlog(
222
224
  // Create a blog archive route
223
225
  const archiveProp = await createData(
224
226
  `${docuHash(archiveUrl)}.json`,
225
- JSON.stringify({blogPosts}, null, 2),
227
+ JSON.stringify({blogPosts: listedBlogPosts}, null, 2),
226
228
  );
227
229
  addRoute({
228
230
  path: archiveUrl,