@docusaurus/plugin-content-blog 0.0.0-4817 → 0.0.0-4818
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 +1 -1
- package/lib/types.d.ts +12 -10
- package/package.json +9 -9
- package/src/index.ts +1 -1
- package/src/plugin-content-blog.d.ts +9 -10
- package/src/types.ts +14 -12
package/lib/index.js
CHANGED
|
@@ -46,7 +46,7 @@ async function pluginContentBlog(context, options) {
|
|
|
46
46
|
const contentMarkdownGlobs = (0, utils_1.getContentPathList)(contentPaths).flatMap((contentPath) => include.map((pattern) => `${contentPath}/${pattern}`));
|
|
47
47
|
return [authorsMapFilePath, ...contentMarkdownGlobs].filter(Boolean);
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
getTranslationFiles() {
|
|
50
50
|
return (0, translations_1.getTranslationFiles)(options);
|
|
51
51
|
},
|
|
52
52
|
// Fetches blog contents and returns metadata for the necessary routes.
|
package/lib/types.d.ts
CHANGED
|
@@ -8,31 +8,33 @@ import type { BrokenMarkdownLink, ContentPaths } from '@docusaurus/utils';
|
|
|
8
8
|
import type { BlogPostMetadata } from '@docusaurus/plugin-content-blog';
|
|
9
9
|
import type { Metadata as BlogPaginatedMetadata } from '@theme/BlogListPage';
|
|
10
10
|
export declare type BlogContentPaths = ContentPaths;
|
|
11
|
-
export
|
|
11
|
+
export declare type BlogContent = {
|
|
12
12
|
blogSidebarTitle: string;
|
|
13
13
|
blogPosts: BlogPost[];
|
|
14
14
|
blogListPaginated: BlogPaginated[];
|
|
15
15
|
blogTags: BlogTags;
|
|
16
16
|
blogTagsListPath: string | null;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
};
|
|
18
|
+
export declare type BlogTags = {
|
|
19
19
|
[tagKey: string]: BlogTag;
|
|
20
|
-
}
|
|
21
|
-
export
|
|
20
|
+
};
|
|
21
|
+
export declare type BlogTag = {
|
|
22
22
|
name: string;
|
|
23
|
+
/** Blog post permalinks. */
|
|
23
24
|
items: string[];
|
|
24
25
|
permalink: string;
|
|
25
26
|
pages: BlogPaginated[];
|
|
26
|
-
}
|
|
27
|
-
export
|
|
27
|
+
};
|
|
28
|
+
export declare type BlogPost = {
|
|
28
29
|
id: string;
|
|
29
30
|
metadata: BlogPostMetadata;
|
|
30
31
|
content: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export declare type BlogPaginated = {
|
|
33
34
|
metadata: BlogPaginatedMetadata;
|
|
35
|
+
/** Blog post permalinks. */
|
|
34
36
|
items: string[];
|
|
35
|
-
}
|
|
37
|
+
};
|
|
36
38
|
export declare type BlogBrokenMarkdownLink = BrokenMarkdownLink<BlogContentPaths>;
|
|
37
39
|
export declare type BlogMarkdownLoaderOptions = {
|
|
38
40
|
siteDir: string;
|
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-4818",
|
|
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-4818",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-4818",
|
|
23
|
+
"@docusaurus/mdx-loader": "0.0.0-4818",
|
|
24
|
+
"@docusaurus/utils": "0.0.0-4818",
|
|
25
|
+
"@docusaurus/utils-common": "0.0.0-4818",
|
|
26
|
+
"@docusaurus/utils-validation": "0.0.0-4818",
|
|
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-4818",
|
|
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": "0ea48452c51db14e48c6395071903307663e2281"
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
10
10
|
import type {FrontMatterTag, Tag} from '@docusaurus/utils';
|
|
11
11
|
import type {Overwrite} from 'utility-types';
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type Assets = {
|
|
14
14
|
/**
|
|
15
15
|
* If `metadata.image` is a collocated image path, this entry will be the
|
|
16
16
|
* bundler-generated image path. Otherwise, it's empty, and the image URL
|
|
@@ -25,13 +25,9 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
25
25
|
* should be accessed through `authors.imageURL`.
|
|
26
26
|
*/
|
|
27
27
|
authorsImageUrls: (string | undefined)[];
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
* Unknown keys are allowed, so that we can pass custom fields to authors,
|
|
32
|
-
* e.g., `twitter`.
|
|
33
|
-
*/
|
|
34
|
-
export interface Author extends Record<string, unknown> {
|
|
30
|
+
export type Author = {
|
|
35
31
|
/**
|
|
36
32
|
* If `name` doesn't exist, an `imageURL` is expected.
|
|
37
33
|
*/
|
|
@@ -55,7 +51,12 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
55
51
|
* to generate a fallback `mailto:` URL.
|
|
56
52
|
*/
|
|
57
53
|
email?: string;
|
|
58
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Unknown keys are allowed, so that we can pass custom fields to authors,
|
|
56
|
+
* e.g., `twitter`.
|
|
57
|
+
*/
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
};
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* Everything is partial/unnormalized, because front matter is always
|
|
@@ -443,8 +444,6 @@ declare module '@theme/BlogPostPage' {
|
|
|
443
444
|
>;
|
|
444
445
|
|
|
445
446
|
export type Content = {
|
|
446
|
-
// TODO remove this. `metadata.frontMatter` is preferred because it can be
|
|
447
|
-
// accessed in enhanced plugins
|
|
448
447
|
/** Same as `metadata.frontMatter` */
|
|
449
448
|
readonly frontMatter: FrontMatter;
|
|
450
449
|
/**
|
package/src/types.ts
CHANGED
|
@@ -11,39 +11,41 @@ import type {Metadata as BlogPaginatedMetadata} from '@theme/BlogListPage';
|
|
|
11
11
|
|
|
12
12
|
export type BlogContentPaths = ContentPaths;
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export type BlogContent = {
|
|
15
15
|
blogSidebarTitle: string;
|
|
16
16
|
blogPosts: BlogPost[];
|
|
17
17
|
blogListPaginated: BlogPaginated[];
|
|
18
18
|
blogTags: BlogTags;
|
|
19
19
|
blogTagsListPath: string | null;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export type BlogTags = {
|
|
23
23
|
// TODO, the key is the tag slug/permalink
|
|
24
24
|
// This is due to legacy frontmatter: tags:
|
|
25
25
|
// [{label: "xyz", permalink: "/1"}, {label: "xyz", permalink: "/2"}]
|
|
26
26
|
// Soon we should forbid declaring permalink through frontmatter
|
|
27
27
|
[tagKey: string]: BlogTag;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
|
-
export
|
|
30
|
+
export type BlogTag = {
|
|
31
31
|
name: string;
|
|
32
|
-
|
|
32
|
+
/** Blog post permalinks. */
|
|
33
|
+
items: string[];
|
|
33
34
|
permalink: string;
|
|
34
35
|
pages: BlogPaginated[];
|
|
35
|
-
}
|
|
36
|
+
};
|
|
36
37
|
|
|
37
|
-
export
|
|
38
|
+
export type BlogPost = {
|
|
38
39
|
id: string;
|
|
39
40
|
metadata: BlogPostMetadata;
|
|
40
41
|
content: string;
|
|
41
|
-
}
|
|
42
|
+
};
|
|
42
43
|
|
|
43
|
-
export
|
|
44
|
+
export type BlogPaginated = {
|
|
44
45
|
metadata: BlogPaginatedMetadata;
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
/** Blog post permalinks. */
|
|
47
|
+
items: string[];
|
|
48
|
+
};
|
|
47
49
|
|
|
48
50
|
export type BlogBrokenMarkdownLink = BrokenMarkdownLink<BlogContentPaths>;
|
|
49
51
|
export type BlogMarkdownLoaderOptions = {
|