mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 06:27:02 +02:00
refactor(theme): split BlogPostItem into smaller theme subcomponents (#7716)
This commit is contained in:
parent
c7f18801da
commit
c3ff131110
43 changed files with 938 additions and 600 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
declare module '@docusaurus/plugin-content-blog' {
|
||||
import type {LoadedMDXContent} from '@docusaurus/mdx-loader';
|
||||
import type {MDXOptions} from '@docusaurus/mdx-loader';
|
||||
import type {FrontMatterTag, Tag} from '@docusaurus/utils';
|
||||
import type {Plugin, LoadContext} from '@docusaurus/types';
|
||||
|
@ -201,7 +202,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|||
/**
|
||||
* Whether the truncate marker exists in the post's content.
|
||||
*/
|
||||
readonly truncated?: boolean;
|
||||
readonly hasTruncateMarker: boolean;
|
||||
/**
|
||||
* Used in pagination. Generated after the other metadata, so not readonly.
|
||||
* Content is just a subset of another post's metadata.
|
||||
|
@ -462,25 +463,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
|||
items: string[];
|
||||
};
|
||||
|
||||
export default function pluginContentBlog(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Promise<Plugin<BlogContent>>;
|
||||
}
|
||||
|
||||
declare module '@theme/BlogPostPage' {
|
||||
import type {LoadedMDXContent} from '@docusaurus/mdx-loader';
|
||||
import type {
|
||||
BlogPostFrontMatter,
|
||||
BlogPostMetadata,
|
||||
Assets,
|
||||
BlogSidebar,
|
||||
} from '@docusaurus/plugin-content-blog';
|
||||
import type {Overwrite} from 'utility-types';
|
||||
|
||||
export type FrontMatter = BlogPostFrontMatter;
|
||||
|
||||
export type Metadata = Overwrite<
|
||||
type PropBlogPostMetadata = Overwrite<
|
||||
BlogPostMetadata,
|
||||
{
|
||||
/** The publish date of the post. Serialized from the `Date` object. */
|
||||
|
@ -488,7 +471,28 @@ declare module '@theme/BlogPostPage' {
|
|||
}
|
||||
>;
|
||||
|
||||
export type Content = LoadedMDXContent<FrontMatter, Metadata, Assets>;
|
||||
export type PropBlogPostContent = LoadedMDXContent<
|
||||
BlogPostFrontMatter,
|
||||
PropBlogPostMetadata,
|
||||
Assets
|
||||
>;
|
||||
|
||||
export default function pluginContentBlog(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Promise<Plugin<BlogContent>>;
|
||||
}
|
||||
|
||||
declare module '@theme/BlogPostPage' {
|
||||
import type {
|
||||
BlogPostFrontMatter,
|
||||
BlogSidebar,
|
||||
PropBlogPostContent,
|
||||
} from '@docusaurus/plugin-content-blog';
|
||||
|
||||
export type FrontMatter = BlogPostFrontMatter;
|
||||
|
||||
export type Content = PropBlogPostContent;
|
||||
|
||||
export interface Props {
|
||||
/** Blog sidebar. */
|
||||
|
@ -500,6 +504,10 @@ declare module '@theme/BlogPostPage' {
|
|||
export default function BlogPostPage(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/BlogPostPage/Metadata' {
|
||||
export default function BlogPostPageMetadata(): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/BlogListPage' {
|
||||
import type {Content} from '@theme/BlogPostPage';
|
||||
import type {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue