mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
feat(v2): add option for blog meta title #3571
* feat(blog-meta-title): add support for additional meta title * retrocompatible blog title Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
2e51034b0c
commit
d1510770f4
8 changed files with 18 additions and 6 deletions
|
@ -140,6 +140,7 @@ export default function pluginContentBlog(
|
|||
? blogPaginationPermalink(page + 1)
|
||||
: null,
|
||||
blogDescription: options.blogDescription,
|
||||
blogTitle: options.blogTitle,
|
||||
},
|
||||
items: blogPosts
|
||||
.slice(page * postsPerPage, (page + 1) * postsPerPage)
|
||||
|
|
|
@ -27,6 +27,7 @@ export const DEFAULT_OPTIONS = {
|
|||
blogPostComponent: '@theme/BlogPostPage',
|
||||
blogListComponent: '@theme/BlogListPage',
|
||||
blogDescription: 'Blog',
|
||||
blogTitle: 'Blog',
|
||||
postsPerPage: 10,
|
||||
include: ['*.md', '*.mdx'],
|
||||
routeBasePath: 'blog',
|
||||
|
@ -52,6 +53,7 @@ export const PluginOptionSchema = Joi.object({
|
|||
blogTagsPostsComponent: Joi.string().default(
|
||||
DEFAULT_OPTIONS.blogTagsPostsComponent,
|
||||
),
|
||||
blogTitle: Joi.string().allow('').default(DEFAULT_OPTIONS.blogTitle),
|
||||
blogDescription: Joi.string()
|
||||
.allow('')
|
||||
.default(DEFAULT_OPTIONS.blogDescription),
|
||||
|
|
|
@ -29,6 +29,7 @@ export interface PluginOptions {
|
|||
blogPostComponent: string;
|
||||
blogTagsListComponent: string;
|
||||
blogTagsPostsComponent: string;
|
||||
blogTitle: string;
|
||||
blogDescription: string;
|
||||
remarkPlugins: ([Function, object] | Function)[];
|
||||
beforeDefaultRehypePlugins: ([Function, object] | Function)[];
|
||||
|
@ -70,6 +71,7 @@ export interface BlogPaginatedMetadata {
|
|||
totalCount: number;
|
||||
previousPage: string | null;
|
||||
nextPage: string | null;
|
||||
blogTitle: string;
|
||||
blogDescription: string;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue