mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Add config option for setting title of the blog sidebar (#770)
* Allow controlling the title of the blog sidebar * Update guides-blog.md
This commit is contained in:
parent
62a2c7c1a5
commit
58fba70dea
4 changed files with 19 additions and 3 deletions
|
@ -14,11 +14,12 @@ const MetadataBlog = require('./MetadataBlog.js');
|
|||
class BlogSidebar extends React.Component {
|
||||
render() {
|
||||
let blogSidebarCount = 5;
|
||||
let blogSidebarTitle = 'Recent Posts';
|
||||
let blogSidebarTitleConfig = this.props.config.blogSidebarTitle || {};
|
||||
let blogSidebarTitle = blogSidebarTitleConfig.default || 'Recent Posts';
|
||||
if (this.props.config.blogSidebarCount) {
|
||||
if (this.props.config.blogSidebarCount == 'ALL') {
|
||||
blogSidebarCount = MetadataBlog.length;
|
||||
blogSidebarTitle = 'All Blog Posts';
|
||||
blogSidebarTitle = blogSidebarTitleConfig.all || 'All Blog Posts';
|
||||
} else {
|
||||
blogSidebarCount = this.props.config.blogSidebarCount;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue