feat: 优化head title

This commit is contained in:
neo 2023-08-11 00:27:07 +08:00
parent c8257eeadd
commit 38feb3e2f7

View File

@ -78,7 +78,7 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
locale, locale,
} = useContext(context); } = useContext(context);
const { mode, repository, logo } = config const { mode, repository, logo, title } = config
const { pathname } = useLocation(); const { pathname } = useLocation();
@ -129,8 +129,8 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
}} }}
> >
<Helmet> <Helmet>
{meta.title && <title>{meta.title}</title>} {meta.title && <title>{meta.title + ' - ' + title}</title>}
{meta.title && <meta property="og:title" content={meta.title} />} {meta.title && <meta property="og:title" content={meta.title + ' - ' + title} />}
{meta.description && <meta name="description" content={meta.description} />} {meta.description && <meta name="description" content={meta.description} />}
{meta.description && ( {meta.description && (
<meta property="og:description" content={meta.description} /> <meta property="og:description" content={meta.description} />