chore: add some seo options and params

This commit is contained in:
2023-04-03 14:16:11 +02:00
parent 99d42b8de4
commit abc9cdbe26
6 changed files with 13 additions and 4 deletions

View File

@@ -10,9 +10,16 @@ interface Props {
description?: string;
socialImage?: string;
children: React.ReactNode;
noIndex?: boolean;
}
const Layout: React.FC<Props> = ({ children, title, description, socialImage = "" }: Props) => {
const Layout: React.FC<Props> = ({
children,
title,
description,
socialImage = "",
noIndex = false,
}: Props) => {
const { author, url } = useSiteMetadata();
const metaImage = socialImage || author.photo;
const metaImageUrl = url + metaImage;
@@ -29,6 +36,7 @@ const Layout: React.FC<Props> = ({ children, title, description, socialImage = "
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={metaImageUrl} />
{noIndex && <meta name="robots" content="noindex" />}
</Helmet>
{children}
<CookieBar />

View File

@@ -28,7 +28,7 @@ const TagTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
currentPage > 0 ? `${group} - Page ${currentPage} - ${siteTitle}` : `${group} - ${siteTitle}`;
return (
<Layout title={pageTitle} description={siteSubtitle}>
<Layout title={pageTitle} description={siteSubtitle} noIndex>
<Sidebar />
<Page title={group}>
<Feed edges={edges} />