docusaurus/packages/docusaurus-plugin-content-blog/index.d.ts
Joshua Chen 493225a3c6
feat(plugin-blog): multi-authors support + authors.yml global configuration (#5396)
* Complete function

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* A lot of blank lines

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More lenient validation

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove or

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Simpler logic

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Expand docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Dogfood

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More writeup

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move mergeAuthorMap to authors.ts

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Unbreak relative assets

* Update docs

* Clarify in docs

* simplify feed authors

* rename authorMap -> authorsMap

* mergeAuthorsMap -> getBlogPostAuthors

* website => 5 blog posts per page

* improve authors map file

* Extract new theme authors components + display in row

* add comment for meta array syntaxes

* blog => getPathsToWatch should watch authorsMap file

* remove useless v1 blog FBID frontmatter

* keep older frontmatter syntax for now

* revert blog frontmatter

* Better console message

* better blog authors frontmatter impl

* add multi authors to beta blog post + fix some authors margins

* fix React key

* Refactor: mdx loader should support a more flexible assets system (poc, not documented yet)

* better display of blog post authors: adapt layout to authors count + add line clamp

* smaller local image

* fix blog feed tests

* fix blog frontmatter tests + improve validation schema

* add more frontmatter tests

* add tests for getAuthorsMapFilePath

* tests for validateAuthorsMapFile

* add tests for readAuthorsMapFile

* test getAuthorsMap

* exhaustive tests for getBlogPostAuthors

* fix remaining tests

* missing blog plugin author tests

* fix windows tests

* improve blog multi-author's doc

* Use new format in init template

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Improve error message

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* update feed snapshot

* blog authors: limit to 2 cols + fix margins for no authors

* minor doc improvements

* better init template blog posts, demonstrating Blog features

* replace the legacy blog author frontmatter in remaining places

* Prefer using clsx

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* cleanup getColClassName

* remove blog author name/title line-clamping

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-26 12:21:58 +02:00

124 lines
3.3 KiB
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
declare module '@theme/BlogSidebar' {
export type BlogSidebarItem = {title: string; permalink: string};
export type BlogSidebar = {
title: string;
items: BlogSidebarItem[];
};
export type Props = {
readonly sidebar: BlogSidebar;
};
const BlogSidebar: (props: Props) => JSX.Element;
export default BlogSidebar;
}
declare module '@theme/BlogPostPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
export type FrontMatter = import('./src/blogFrontMatter').BlogPostFrontMatter;
export type Assets = import('./src/types').Assets;
export type Metadata = {
readonly title: string;
readonly date: string;
readonly formattedDate: string;
readonly permalink: string;
readonly description?: string;
readonly editUrl?: string;
readonly readingTime?: number;
readonly truncated?: string;
readonly nextItem?: {readonly title: string; readonly permalink: string};
readonly prevItem?: {readonly title: string; readonly permalink: string};
readonly authors: import('./src/types').Author[];
readonly tags: readonly {
readonly label: string;
readonly permalink: string;
}[];
};
export type Content = {
readonly frontMatter: FrontMatter;
readonly assets: Assets;
readonly metadata: Metadata;
readonly toc: readonly TOCItem[];
(): JSX.Element;
};
export type Props = {
readonly sidebar: BlogSidebar;
readonly content: Content;
};
const BlogPostPage: (props: Props) => JSX.Element;
export default BlogPostPage;
}
declare module '@theme/BlogListPage' {
import type {Content} from '@theme/BlogPostPage';
import type {BlogSidebar} from '@theme/BlogSidebar';
export type Item = {
readonly content: () => JSX.Element;
};
export type Metadata = {
readonly blogTitle: string;
readonly blogDescription: string;
readonly nextPage?: string;
readonly page: number;
readonly permalink: string;
readonly postsPerPage: number;
readonly previousPage?: string;
readonly totalCount: number;
readonly totalPages: number;
};
export type Props = {
readonly sidebar: BlogSidebar;
readonly metadata: Metadata;
readonly items: readonly {readonly content: Content}[];
};
const BlogListPage: (props: Props) => JSX.Element;
export default BlogListPage;
}
declare module '@theme/BlogTagsListPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
export type Tag = {
permalink: string;
name: string;
count: number;
allTagsPath: string;
slug: string;
};
export type Props = {
readonly sidebar: BlogSidebar;
readonly tags: Readonly<Record<string, Tag>>;
};
const BlogTagsListPage: (props: Props) => JSX.Element;
export default BlogTagsListPage;
}
declare module '@theme/BlogTagsPostsPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
import type {Tag} from '@theme/BlogTagsListPage';
import type {Content} from '@theme/BlogPostPage';
export type Props = {
readonly sidebar: BlogSidebar;
readonly metadata: Tag;
readonly items: readonly {readonly content: Content}[];
};
}