@docusaurus/plugin-content-blog 0.0.0-4770 → 0.0.0-4771
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 +3 -1
- package/lib/blogUtils.d.ts +3 -1
- package/lib/frontMatter.d.ts +3 -1
- package/lib/types.d.ts +3 -1
- package/package.json +9 -9
- package/src/authors.ts +1 -1
- package/src/blogUtils.ts +3 -3
- package/src/deps.d.ts +1 -1
- package/src/frontMatter.ts +3 -3
- package/src/index.ts +2 -2
- package/src/plugin-content-blog.d.ts +4 -4
- package/src/types.ts +1 -1
package/lib/authors.d.ts
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { BlogContentPaths } from './types';
|
|
8
8
|
import type { Author, BlogPostFrontMatter } from '@docusaurus/plugin-content-blog';
|
|
9
|
-
export declare type AuthorsMap =
|
|
9
|
+
export declare type AuthorsMap = {
|
|
10
|
+
[authorKey: string]: Author;
|
|
11
|
+
};
|
|
10
12
|
export declare function validateAuthorsMap(content: unknown): AuthorsMap;
|
|
11
13
|
export declare function getAuthorsMap(params: {
|
|
12
14
|
authorsMapPath: string;
|
package/lib/blogUtils.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ import type { BlogPost, BlogContentPaths, BlogMarkdownLoaderOptions, BlogTags, B
|
|
|
8
8
|
import type { LoadContext } from '@docusaurus/types';
|
|
9
9
|
import type { PluginOptions } from '@docusaurus/plugin-content-blog';
|
|
10
10
|
export declare function truncate(fileString: string, truncateMarker: RegExp): string;
|
|
11
|
-
export declare function getSourceToPermalink(blogPosts: BlogPost[]):
|
|
11
|
+
export declare function getSourceToPermalink(blogPosts: BlogPost[]): {
|
|
12
|
+
[aliasedPath: string]: string;
|
|
13
|
+
};
|
|
12
14
|
export declare function paginateBlogPosts({ blogPosts, basePageUrl, blogTitle, blogDescription, postsPerPageOption, }: {
|
|
13
15
|
blogPosts: BlogPost[];
|
|
14
16
|
basePageUrl: string;
|
package/lib/frontMatter.d.ts
CHANGED
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { BlogPostFrontMatter } from '@docusaurus/plugin-content-blog';
|
|
8
|
-
export declare function validateBlogPostFrontMatter(frontMatter:
|
|
8
|
+
export declare function validateBlogPostFrontMatter(frontMatter: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}): BlogPostFrontMatter;
|
package/lib/types.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare type BlogMarkdownLoaderOptions = {
|
|
|
38
38
|
siteDir: string;
|
|
39
39
|
contentPaths: BlogContentPaths;
|
|
40
40
|
truncateMarker: RegExp;
|
|
41
|
-
sourceToPermalink:
|
|
41
|
+
sourceToPermalink: {
|
|
42
|
+
[aliasedPath: string]: string;
|
|
43
|
+
};
|
|
42
44
|
onBrokenMarkdownLink: (brokenMarkdownLink: BlogBrokenMarkdownLink) => void;
|
|
43
45
|
};
|
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-4771",
|
|
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-4771",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-4771",
|
|
23
|
+
"@docusaurus/mdx-loader": "0.0.0-4771",
|
|
24
|
+
"@docusaurus/utils": "0.0.0-4771",
|
|
25
|
+
"@docusaurus/utils-common": "0.0.0-4771",
|
|
26
|
+
"@docusaurus/utils-validation": "0.0.0-4771",
|
|
27
27
|
"cheerio": "^1.0.0-rc.10",
|
|
28
28
|
"feed": "^4.2.2",
|
|
29
29
|
"fs-extra": "^10.0.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"webpack": "^5.70.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@docusaurus/types": "0.0.0-
|
|
38
|
+
"@docusaurus/types": "0.0.0-4771",
|
|
39
39
|
"escape-string-regexp": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=14"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1b462b797e77b4a018e3c1ebb36ec87521ad4d07"
|
|
49
49
|
}
|
package/src/authors.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
BlogPostFrontMatterAuthors,
|
|
16
16
|
} from '@docusaurus/plugin-content-blog';
|
|
17
17
|
|
|
18
|
-
export type AuthorsMap =
|
|
18
|
+
export type AuthorsMap = {[authorKey: string]: Author};
|
|
19
19
|
|
|
20
20
|
const AuthorsMapSchema = Joi.object<AuthorsMap>()
|
|
21
21
|
.pattern(
|
package/src/blogUtils.ts
CHANGED
|
@@ -43,9 +43,9 @@ export function truncate(fileString: string, truncateMarker: RegExp): string {
|
|
|
43
43
|
return fileString.split(truncateMarker, 1).shift()!;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function getSourceToPermalink(
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
export function getSourceToPermalink(blogPosts: BlogPost[]): {
|
|
47
|
+
[aliasedPath: string]: string;
|
|
48
|
+
} {
|
|
49
49
|
return Object.fromEntries(
|
|
50
50
|
blogPosts.map(({metadata: {source, permalink}}) => [source, permalink]),
|
|
51
51
|
);
|
package/src/deps.d.ts
CHANGED
package/src/frontMatter.ts
CHANGED
|
@@ -74,8 +74,8 @@ const BlogFrontMatterSchema = Joi.object<BlogPostFrontMatter>({
|
|
|
74
74
|
'{#label} blog frontMatter field is deprecated. Please use {#alternative} instead.',
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
export function validateBlogPostFrontMatter(
|
|
78
|
-
|
|
79
|
-
): BlogPostFrontMatter {
|
|
77
|
+
export function validateBlogPostFrontMatter(frontMatter: {
|
|
78
|
+
[key: string]: unknown;
|
|
79
|
+
}): BlogPostFrontMatter {
|
|
80
80
|
return validateFrontMatter(frontMatter, BlogFrontMatterSchema);
|
|
81
81
|
}
|
package/src/index.ts
CHANGED
|
@@ -205,7 +205,7 @@ export default async function pluginContentBlog(
|
|
|
205
205
|
blogTagsListPath,
|
|
206
206
|
} = blogContents;
|
|
207
207
|
|
|
208
|
-
const blogItemsToMetadata:
|
|
208
|
+
const blogItemsToMetadata: {[postId: string]: BlogPostMetadata} = {};
|
|
209
209
|
|
|
210
210
|
const sidebarBlogPosts =
|
|
211
211
|
options.blogSidebarCount === 'ALL'
|
|
@@ -316,7 +316,7 @@ export default async function pluginContentBlog(
|
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
const tagsModule:
|
|
319
|
+
const tagsModule: {[tagName: string]: TagModule} = Object.fromEntries(
|
|
320
320
|
Object.entries(blogTags).map(([, tag]) => {
|
|
321
321
|
const tagModule: TagModule = {
|
|
322
322
|
allTagsPath: blogTagsListPath,
|
|
@@ -232,7 +232,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
232
232
|
/**
|
|
233
233
|
* Front matter, as-is.
|
|
234
234
|
*/
|
|
235
|
-
readonly frontMatter: BlogPostFrontMatter &
|
|
235
|
+
readonly frontMatter: BlogPostFrontMatter & {[key: string]: unknown};
|
|
236
236
|
/**
|
|
237
237
|
* Tags, normalized.
|
|
238
238
|
*/
|
|
@@ -301,7 +301,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
301
301
|
/** Markdown content. */
|
|
302
302
|
content: string;
|
|
303
303
|
/** Front matter. */
|
|
304
|
-
frontMatter?: BlogPostFrontMatter &
|
|
304
|
+
frontMatter?: BlogPostFrontMatter & {[key: string]: unknown};
|
|
305
305
|
/** Options accepted by ngryman/reading-time. */
|
|
306
306
|
options?: ReadingTimeOptions;
|
|
307
307
|
}) => number;
|
|
@@ -402,7 +402,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
402
402
|
* unlocalized file. Ignored when `editUrl` is a function.
|
|
403
403
|
*/
|
|
404
404
|
editLocalizedFiles?: boolean;
|
|
405
|
-
admonitions:
|
|
405
|
+
admonitions: {[key: string]: unknown};
|
|
406
406
|
/** Path to the authors map file, relative to the blog content directory. */
|
|
407
407
|
authorsMapPath: string;
|
|
408
408
|
/** A callback to customize the reading time number displayed. */
|
|
@@ -545,7 +545,7 @@ declare module '@theme/BlogTagsListPage' {
|
|
|
545
545
|
/** Blog sidebar. */
|
|
546
546
|
readonly sidebar: BlogSidebar;
|
|
547
547
|
/** A map from tag names to the full tag module. */
|
|
548
|
-
readonly tags: Readonly<
|
|
548
|
+
readonly tags: Readonly<{[tagName: string]: TagModule}>;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
export default function BlogTagsListPage(props: Props): JSX.Element;
|
package/src/types.ts
CHANGED
|
@@ -50,6 +50,6 @@ export type BlogMarkdownLoaderOptions = {
|
|
|
50
50
|
siteDir: string;
|
|
51
51
|
contentPaths: BlogContentPaths;
|
|
52
52
|
truncateMarker: RegExp;
|
|
53
|
-
sourceToPermalink:
|
|
53
|
+
sourceToPermalink: {[aliasedPath: string]: string};
|
|
54
54
|
onBrokenMarkdownLink: (brokenMarkdownLink: BlogBrokenMarkdownLink) => void;
|
|
55
55
|
};
|