mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): use site title if enabled blog-only mode (#2259)
This commit is contained in:
parent
bb82d0e073
commit
b1e079f4fe
3 changed files with 9 additions and 3 deletions
|
@ -7,15 +7,21 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import Layout from '@theme/Layout';
|
import Layout from '@theme/Layout';
|
||||||
import BlogPostItem from '@theme/BlogPostItem';
|
import BlogPostItem from '@theme/BlogPostItem';
|
||||||
import BlogListPaginator from '@theme/BlogListPaginator';
|
import BlogListPaginator from '@theme/BlogListPaginator';
|
||||||
|
|
||||||
function BlogListPage(props) {
|
function BlogListPage(props) {
|
||||||
const {metadata, items} = props;
|
const {metadata, items} = props;
|
||||||
|
const {
|
||||||
|
siteConfig: {title: siteTitle},
|
||||||
|
} = useDocusaurusContext();
|
||||||
|
const isBlogOnlyMode = metadata.permalink === '/';
|
||||||
|
const title = isBlogOnlyMode ? siteTitle : 'Blog';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Blog" description="Blog">
|
<Layout title={title} description="Blog">
|
||||||
<div className="container margin-vert--xl">
|
<div className="container margin-vert--xl">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--8 col--offset-2">
|
<div className="col col--8 col--offset-2">
|
||||||
|
|
|
@ -48,7 +48,7 @@ function BlogTagsListPage(props) {
|
||||||
.filter(item => item != null);
|
.filter(item => item != null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Blog Tags" description="Blog Tags">
|
<Layout title="Tags" description="Blog Tags">
|
||||||
<div className="container margin-vert--xl">
|
<div className="container margin-vert--xl">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--8 col--offset-2">
|
<div className="col col--8 col--offset-2">
|
||||||
|
|
|
@ -21,7 +21,7 @@ function BlogTagsPostPage(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title={`Blog | Tagged "${tagName}"`}
|
title={`Posts tagged "${tagName}"`}
|
||||||
description={`Blog | Tagged "${tagName}"`}>
|
description={`Blog | Tagged "${tagName}"`}>
|
||||||
<div className="container margin-vert--xl">
|
<div className="container margin-vert--xl">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue