@docusaurus/plugin-content-blog 0.0.0-4548 → 0.0.0-4552
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 +2 -2
- package/lib/pluginOptionSchema.js +2 -0
- package/package.json +9 -9
- package/src/index.ts +2 -1
- package/src/plugin-content-blog.d.ts +1 -0
- package/src/pluginOptionSchema.ts +4 -0
- package/src/types.ts +2 -1
package/lib/index.js
CHANGED
|
@@ -110,7 +110,7 @@ async function pluginContentBlog(context, options) {
|
|
|
110
110
|
if (!blogContents) {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
const { blogListComponent, blogPostComponent, blogTagsListComponent, blogTagsPostsComponent, routeBasePath, archiveBasePath, } = options;
|
|
113
|
+
const { blogListComponent, blogPostComponent, blogTagsListComponent, blogTagsPostsComponent, blogArchiveComponent, routeBasePath, archiveBasePath, } = options;
|
|
114
114
|
const { addRoute, createData } = actions;
|
|
115
115
|
const { blogSidebarTitle, blogPosts, blogListPaginated, blogTags, blogTagsListPath, } = blogContents;
|
|
116
116
|
const blogItemsToMetadata = {};
|
|
@@ -127,7 +127,7 @@ async function pluginContentBlog(context, options) {
|
|
|
127
127
|
const archiveProp = await createData(`${(0, utils_1.docuHash)(archiveUrl)}.json`, JSON.stringify({ blogPosts }, null, 2));
|
|
128
128
|
addRoute({
|
|
129
129
|
path: archiveUrl,
|
|
130
|
-
component:
|
|
130
|
+
component: blogArchiveComponent,
|
|
131
131
|
exact: true,
|
|
132
132
|
modules: {
|
|
133
133
|
archive: aliasedSource(archiveProp),
|
|
@@ -22,6 +22,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
22
22
|
blogTagsListComponent: '@theme/BlogTagsListPage',
|
|
23
23
|
blogPostComponent: '@theme/BlogPostPage',
|
|
24
24
|
blogListComponent: '@theme/BlogListPage',
|
|
25
|
+
blogArchiveComponent: '@theme/BlogArchivePage',
|
|
25
26
|
blogDescription: 'Blog',
|
|
26
27
|
blogTitle: 'Blog',
|
|
27
28
|
blogSidebarCount: 5,
|
|
@@ -57,6 +58,7 @@ exports.PluginOptionSchema = utils_validation_1.Joi.object({
|
|
|
57
58
|
blogPostComponent: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.blogPostComponent),
|
|
58
59
|
blogTagsListComponent: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.blogTagsListComponent),
|
|
59
60
|
blogTagsPostsComponent: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.blogTagsPostsComponent),
|
|
61
|
+
blogArchiveComponent: utils_validation_1.Joi.string().default(exports.DEFAULT_OPTIONS.blogArchiveComponent),
|
|
60
62
|
blogTitle: utils_validation_1.Joi.string().allow('').default(exports.DEFAULT_OPTIONS.blogTitle),
|
|
61
63
|
blogDescription: utils_validation_1.Joi.string()
|
|
62
64
|
.allow('')
|
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-4552",
|
|
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-4552",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-4552",
|
|
23
|
+
"@docusaurus/mdx-loader": "0.0.0-4552",
|
|
24
|
+
"@docusaurus/utils": "0.0.0-4552",
|
|
25
|
+
"@docusaurus/utils-common": "0.0.0-4552",
|
|
26
|
+
"@docusaurus/utils-validation": "0.0.0-4552",
|
|
27
27
|
"cheerio": "^1.0.0-rc.10",
|
|
28
28
|
"feed": "^4.2.2",
|
|
29
29
|
"fs-extra": "^10.0.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"webpack": "^5.68.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@docusaurus/types": "0.0.0-
|
|
38
|
+
"@docusaurus/types": "0.0.0-4552",
|
|
39
39
|
"escape-string-regexp": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=14"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "52dec33f17a69acc617e177547f1f8cb1d2acf45"
|
|
50
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -202,6 +202,7 @@ export default async function pluginContentBlog(
|
|
|
202
202
|
blogPostComponent,
|
|
203
203
|
blogTagsListComponent,
|
|
204
204
|
blogTagsPostsComponent,
|
|
205
|
+
blogArchiveComponent,
|
|
205
206
|
routeBasePath,
|
|
206
207
|
archiveBasePath,
|
|
207
208
|
} = options;
|
|
@@ -235,7 +236,7 @@ export default async function pluginContentBlog(
|
|
|
235
236
|
);
|
|
236
237
|
addRoute({
|
|
237
238
|
path: archiveUrl,
|
|
238
|
-
component:
|
|
239
|
+
component: blogArchiveComponent,
|
|
239
240
|
exact: true,
|
|
240
241
|
modules: {
|
|
241
242
|
archive: aliasedSource(archiveProp),
|
|
@@ -120,6 +120,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
120
120
|
blogPostComponent: string;
|
|
121
121
|
blogTagsListComponent: string;
|
|
122
122
|
blogTagsPostsComponent: string;
|
|
123
|
+
blogArchiveComponent: string;
|
|
123
124
|
blogTitle: string;
|
|
124
125
|
blogDescription: string;
|
|
125
126
|
blogSidebarCount: number | 'ALL';
|
|
@@ -28,6 +28,7 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|
|
28
28
|
blogTagsListComponent: '@theme/BlogTagsListPage',
|
|
29
29
|
blogPostComponent: '@theme/BlogPostPage',
|
|
30
30
|
blogListComponent: '@theme/BlogListPage',
|
|
31
|
+
blogArchiveComponent: '@theme/BlogArchivePage',
|
|
31
32
|
blogDescription: 'Blog',
|
|
32
33
|
blogTitle: 'Blog',
|
|
33
34
|
blogSidebarCount: 5,
|
|
@@ -68,6 +69,9 @@ export const PluginOptionSchema = Joi.object<PluginOptions>({
|
|
|
68
69
|
blogTagsPostsComponent: Joi.string().default(
|
|
69
70
|
DEFAULT_OPTIONS.blogTagsPostsComponent,
|
|
70
71
|
),
|
|
72
|
+
blogArchiveComponent: Joi.string().default(
|
|
73
|
+
DEFAULT_OPTIONS.blogArchiveComponent,
|
|
74
|
+
),
|
|
71
75
|
blogTitle: Joi.string().allow('').default(DEFAULT_OPTIONS.blogTitle),
|
|
72
76
|
blogDescription: Joi.string()
|
|
73
77
|
.allow('')
|
package/src/types.ts
CHANGED
|
@@ -27,7 +27,8 @@ export interface BlogContent {
|
|
|
27
27
|
|
|
28
28
|
export interface BlogTags {
|
|
29
29
|
// TODO, the key is the tag slug/permalink
|
|
30
|
-
// This is due to legacy frontmatter: tags:
|
|
30
|
+
// This is due to legacy frontmatter: tags:
|
|
31
|
+
// [{label: "xyz", permalink: "/1"}, {label: "xyz", permalink: "/2"}]
|
|
31
32
|
// Soon we should forbid declaring permalink through frontmatter
|
|
32
33
|
[tagKey: string]: BlogTag;
|
|
33
34
|
}
|