@docusaurus/plugin-content-blog 3.6.3-canary-6163 → 3.6.3-canary-6167
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/client/contexts.d.ts +1 -1
- package/lib/frontMatter.js +2 -1
- package/lib/props.js +1 -1
- package/package.json +10 -10
- package/src/client/contexts.tsx +1 -1
- package/src/frontMatter.ts +2 -1
- package/src/plugin-content-blog.d.ts +26 -11
- package/src/props.ts +2 -1
package/lib/client/contexts.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function BlogPostProvider({ children, content, isBlogPostPage, }:
|
|
|
22
22
|
children: ReactNode;
|
|
23
23
|
content: PropBlogPostContent;
|
|
24
24
|
isBlogPostPage?: boolean;
|
|
25
|
-
}):
|
|
25
|
+
}): ReactNode;
|
|
26
26
|
/**
|
|
27
27
|
* Returns the data of the currently browsed blog post. Gives access to
|
|
28
28
|
* front matter, metadata, TOC, etc.
|
package/lib/frontMatter.js
CHANGED
|
@@ -23,7 +23,8 @@ const FrontMatterAuthorErrorMessage = '{{#label}} does not look like a valid blo
|
|
|
23
23
|
const BlogFrontMatterSchema = utils_validation_1.JoiFrontMatter.object({
|
|
24
24
|
id: utils_validation_1.JoiFrontMatter.string(),
|
|
25
25
|
title: utils_validation_1.JoiFrontMatter.string().allow(''),
|
|
26
|
-
title_meta: utils_validation_1.JoiFrontMatter.string(),
|
|
26
|
+
title_meta: utils_validation_1.JoiFrontMatter.string().allow(''),
|
|
27
|
+
sidebar_label: utils_validation_1.JoiFrontMatter.string().allow(''),
|
|
27
28
|
description: utils_validation_1.JoiFrontMatter.string().allow(''),
|
|
28
29
|
tags: utils_validation_1.FrontMatterTagsSchema,
|
|
29
30
|
date: utils_validation_1.JoiFrontMatter.date().raw(),
|
package/lib/props.js
CHANGED
|
@@ -34,7 +34,7 @@ function toBlogSidebarProp({ blogSidebarTitle, blogPosts, }) {
|
|
|
34
34
|
return {
|
|
35
35
|
title: blogSidebarTitle,
|
|
36
36
|
items: blogPosts.map((blogPost) => ({
|
|
37
|
-
title: blogPost.metadata.title,
|
|
37
|
+
title: blogPost.metadata.frontMatter.sidebar_label ?? blogPost.metadata.title,
|
|
38
38
|
permalink: blogPost.metadata.permalink,
|
|
39
39
|
unlisted: blogPost.metadata.unlisted,
|
|
40
40
|
date: blogPost.metadata.date,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "3.6.3-canary-
|
|
3
|
+
"version": "3.6.3-canary-6167",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@docusaurus/core": "3.6.3-canary-
|
|
35
|
-
"@docusaurus/logger": "3.6.3-canary-
|
|
36
|
-
"@docusaurus/mdx-loader": "3.6.3-canary-
|
|
37
|
-
"@docusaurus/theme-common": "3.6.3-canary-
|
|
38
|
-
"@docusaurus/types": "3.6.3-canary-
|
|
39
|
-
"@docusaurus/utils": "3.6.3-canary-
|
|
40
|
-
"@docusaurus/utils-common": "3.6.3-canary-
|
|
41
|
-
"@docusaurus/utils-validation": "3.6.3-canary-
|
|
34
|
+
"@docusaurus/core": "3.6.3-canary-6167",
|
|
35
|
+
"@docusaurus/logger": "3.6.3-canary-6167",
|
|
36
|
+
"@docusaurus/mdx-loader": "3.6.3-canary-6167",
|
|
37
|
+
"@docusaurus/theme-common": "3.6.3-canary-6167",
|
|
38
|
+
"@docusaurus/types": "3.6.3-canary-6167",
|
|
39
|
+
"@docusaurus/utils": "3.6.3-canary-6167",
|
|
40
|
+
"@docusaurus/utils-common": "3.6.3-canary-6167",
|
|
41
|
+
"@docusaurus/utils-validation": "3.6.3-canary-6167",
|
|
42
42
|
"cheerio": "1.0.0-rc.12",
|
|
43
43
|
"feed": "^4.2.2",
|
|
44
44
|
"fs-extra": "^11.1.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
63
63
|
"tree-node-cli": "^1.6.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "d8c53eaab293c71917973e7358a894572141e1c8"
|
|
66
66
|
}
|
package/src/client/contexts.tsx
CHANGED
|
@@ -74,7 +74,7 @@ export function BlogPostProvider({
|
|
|
74
74
|
children: ReactNode;
|
|
75
75
|
content: PropBlogPostContent;
|
|
76
76
|
isBlogPostPage?: boolean;
|
|
77
|
-
}):
|
|
77
|
+
}): ReactNode {
|
|
78
78
|
const contextValue = useContextValue({content, isBlogPostPage});
|
|
79
79
|
return <Context.Provider value={contextValue}>{children}</Context.Provider>;
|
|
80
80
|
}
|
package/src/frontMatter.ts
CHANGED
|
@@ -33,7 +33,8 @@ const FrontMatterAuthorErrorMessage =
|
|
|
33
33
|
const BlogFrontMatterSchema = Joi.object<BlogPostFrontMatter>({
|
|
34
34
|
id: Joi.string(),
|
|
35
35
|
title: Joi.string().allow(''),
|
|
36
|
-
title_meta: Joi.string(),
|
|
36
|
+
title_meta: Joi.string().allow(''),
|
|
37
|
+
sidebar_label: Joi.string().allow(''),
|
|
37
38
|
description: Joi.string().allow(''),
|
|
38
39
|
tags: FrontMatterTagsSchema,
|
|
39
40
|
date: Joi.date().raw(),
|
|
@@ -145,7 +145,6 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
145
145
|
title?: string;
|
|
146
146
|
/**
|
|
147
147
|
* Will be used for SEO page metadata and override BlogPostMetadata.title.
|
|
148
|
-
* @see {@link BlogPostMetadata.title_meta}
|
|
149
148
|
*/
|
|
150
149
|
title_meta?: string;
|
|
151
150
|
/**
|
|
@@ -153,6 +152,10 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
153
152
|
* @see {@link BlogPostMetadata.description}
|
|
154
153
|
*/
|
|
155
154
|
description?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Will override the default excerpt.
|
|
157
|
+
*/
|
|
158
|
+
sidebar_label?: string;
|
|
156
159
|
/**
|
|
157
160
|
* Front matter tags, unnormalized.
|
|
158
161
|
* @see {@link BlogPostMetadata.tags}
|
|
@@ -660,6 +663,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|
|
660
663
|
}
|
|
661
664
|
|
|
662
665
|
declare module '@theme/BlogPostPage' {
|
|
666
|
+
import type {ReactNode} from 'react';
|
|
663
667
|
import type {
|
|
664
668
|
BlogPostFrontMatter,
|
|
665
669
|
BlogSidebar,
|
|
@@ -680,18 +684,23 @@ declare module '@theme/BlogPostPage' {
|
|
|
680
684
|
readonly blogMetadata: BlogMetadata;
|
|
681
685
|
}
|
|
682
686
|
|
|
683
|
-
export default function BlogPostPage(props: Props):
|
|
687
|
+
export default function BlogPostPage(props: Props): ReactNode;
|
|
684
688
|
}
|
|
685
689
|
|
|
686
690
|
declare module '@theme/BlogPostPage/Metadata' {
|
|
687
|
-
|
|
691
|
+
import type {ReactNode} from 'react';
|
|
692
|
+
|
|
693
|
+
export default function BlogPostPageMetadata(): ReactNode;
|
|
688
694
|
}
|
|
689
695
|
|
|
690
696
|
declare module '@theme/BlogPostPage/StructuredData' {
|
|
691
|
-
|
|
697
|
+
import type {ReactNode} from 'react';
|
|
698
|
+
|
|
699
|
+
export default function BlogPostStructuredData(): ReactNode;
|
|
692
700
|
}
|
|
693
701
|
|
|
694
702
|
declare module '@theme/BlogListPage' {
|
|
703
|
+
import type {ReactNode} from 'react';
|
|
695
704
|
import type {Content} from '@theme/BlogPostPage';
|
|
696
705
|
import type {
|
|
697
706
|
BlogSidebar,
|
|
@@ -710,10 +719,11 @@ declare module '@theme/BlogListPage' {
|
|
|
710
719
|
readonly items: readonly {readonly content: Content}[];
|
|
711
720
|
}
|
|
712
721
|
|
|
713
|
-
export default function BlogListPage(props: Props):
|
|
722
|
+
export default function BlogListPage(props: Props): ReactNode;
|
|
714
723
|
}
|
|
715
724
|
|
|
716
725
|
declare module '@theme/BlogListPage/StructuredData' {
|
|
726
|
+
import type {ReactNode} from 'react';
|
|
717
727
|
import type {Content} from '@theme/BlogPostPage';
|
|
718
728
|
import type {
|
|
719
729
|
BlogSidebar,
|
|
@@ -732,10 +742,11 @@ declare module '@theme/BlogListPage/StructuredData' {
|
|
|
732
742
|
readonly items: readonly {readonly content: Content}[];
|
|
733
743
|
}
|
|
734
744
|
|
|
735
|
-
export default function BlogListPageStructuredData(props: Props):
|
|
745
|
+
export default function BlogListPageStructuredData(props: Props): ReactNode;
|
|
736
746
|
}
|
|
737
747
|
|
|
738
748
|
declare module '@theme/BlogTagsListPage' {
|
|
749
|
+
import type {ReactNode} from 'react';
|
|
739
750
|
import type {BlogSidebar} from '@docusaurus/plugin-content-blog';
|
|
740
751
|
import type {TagsListItem} from '@docusaurus/utils';
|
|
741
752
|
|
|
@@ -746,10 +757,11 @@ declare module '@theme/BlogTagsListPage' {
|
|
|
746
757
|
readonly tags: TagsListItem[];
|
|
747
758
|
}
|
|
748
759
|
|
|
749
|
-
export default function BlogTagsListPage(props: Props):
|
|
760
|
+
export default function BlogTagsListPage(props: Props): ReactNode;
|
|
750
761
|
}
|
|
751
762
|
|
|
752
763
|
declare module '@theme/Blog/Pages/BlogAuthorsListPage' {
|
|
764
|
+
import type {ReactNode} from 'react';
|
|
753
765
|
import type {
|
|
754
766
|
AuthorItemProp,
|
|
755
767
|
BlogSidebar,
|
|
@@ -762,10 +774,11 @@ declare module '@theme/Blog/Pages/BlogAuthorsListPage' {
|
|
|
762
774
|
readonly authors: AuthorItemProp[];
|
|
763
775
|
}
|
|
764
776
|
|
|
765
|
-
export default function BlogAuthorsListPage(props: Props):
|
|
777
|
+
export default function BlogAuthorsListPage(props: Props): ReactNode;
|
|
766
778
|
}
|
|
767
779
|
|
|
768
780
|
declare module '@theme/Blog/Pages/BlogAuthorsPostsPage' {
|
|
781
|
+
import type {ReactNode} from 'react';
|
|
769
782
|
import type {Content} from '@theme/BlogPostPage';
|
|
770
783
|
import type {
|
|
771
784
|
AuthorItemProp,
|
|
@@ -787,10 +800,11 @@ declare module '@theme/Blog/Pages/BlogAuthorsPostsPage' {
|
|
|
787
800
|
readonly items: readonly {readonly content: Content}[];
|
|
788
801
|
}
|
|
789
802
|
|
|
790
|
-
export default function BlogAuthorsPostsPage(props: Props):
|
|
803
|
+
export default function BlogAuthorsPostsPage(props: Props): ReactNode;
|
|
791
804
|
}
|
|
792
805
|
|
|
793
806
|
declare module '@theme/BlogTagsPostsPage' {
|
|
807
|
+
import type {ReactNode} from 'react';
|
|
794
808
|
import type {Content} from '@theme/BlogPostPage';
|
|
795
809
|
import type {
|
|
796
810
|
BlogSidebar,
|
|
@@ -812,10 +826,11 @@ declare module '@theme/BlogTagsPostsPage' {
|
|
|
812
826
|
readonly items: readonly {readonly content: Content}[];
|
|
813
827
|
}
|
|
814
828
|
|
|
815
|
-
export default function BlogTagsPostsPage(props: Props):
|
|
829
|
+
export default function BlogTagsPostsPage(props: Props): ReactNode;
|
|
816
830
|
}
|
|
817
831
|
|
|
818
832
|
declare module '@theme/BlogArchivePage' {
|
|
833
|
+
import type {ReactNode} from 'react';
|
|
819
834
|
import type {Content} from '@theme/BlogPostPage';
|
|
820
835
|
|
|
821
836
|
/** We may add extra metadata or prune some metadata from here */
|
|
@@ -829,5 +844,5 @@ declare module '@theme/BlogArchivePage' {
|
|
|
829
844
|
};
|
|
830
845
|
}
|
|
831
846
|
|
|
832
|
-
export default function BlogArchivePage(props: Props):
|
|
847
|
+
export default function BlogArchivePage(props: Props): ReactNode;
|
|
833
848
|
}
|
package/src/props.ts
CHANGED
|
@@ -65,7 +65,8 @@ export function toBlogSidebarProp({
|
|
|
65
65
|
return {
|
|
66
66
|
title: blogSidebarTitle,
|
|
67
67
|
items: blogPosts.map((blogPost) => ({
|
|
68
|
-
title:
|
|
68
|
+
title:
|
|
69
|
+
blogPost.metadata.frontMatter.sidebar_label ?? blogPost.metadata.title,
|
|
69
70
|
permalink: blogPost.metadata.permalink,
|
|
70
71
|
unlisted: blogPost.metadata.unlisted,
|
|
71
72
|
date: blogPost.metadata.date,
|