indexing seo changes

This commit is contained in:
2023-01-07 12:34:59 +01:00
parent 141e8014f5
commit 4cb360e59c
7 changed files with 37 additions and 42 deletions

View File

@@ -4,9 +4,17 @@ type seoprops = {
title?: string;
noatsign?: boolean; // simply add "noatsign" as property to element
description?: string;
picture?: string;
dontindex?: boolean;
};
const SEO = ({ title, noatsign, description }: seoprops) => {
const SEO = ({
title,
noatsign,
description,
picture,
dontindex,
}: seoprops) => {
const titleEnhanced = title
? `${title}${noatsign ? "" : " @ gractwo.pl"}`
: "Gractwo!";
@@ -25,15 +33,21 @@ const SEO = ({ title, noatsign, description }: seoprops) => {
<meta property="og:title" content={titleEnhanced} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://gractwo.pl" />
<meta property="og:image" content={remoteLogoRender} />
<meta property="og:image" content={picture || remoteLogoRender} />
<meta property="og:site_name" content="gractwo.pl" />
<meta
property="og:description"
content={description || defaultDescription}
/>
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow" />
<meta
name="robots"
content={dontindex ? "noindex, nofollow" : "index, follow"}
/>
<meta
name="googlebot"
content={dontindex ? "noindex, nofollow" : "index, follow"}
/>
</Head>
);
};

View File

@@ -10,7 +10,7 @@ const PageError404 = () => {
}, [router.asPath]);
return (
<>
<SEO title="404" />
<SEO title="404" dontindex />
<div
style={{
display: "flex",

View File

@@ -1,9 +1,10 @@
import { SEO } from "../components/SEO";
const PageCytaty = () => {
const SEOdesc = `Strona w trakcie budowy - zbiorowisko cytatów użytkowników gractwa!`;
return (
<>
<SEO title="cytaty" />
<SEO title="cytaty" description={SEOdesc} />
<main>Miejsce na stronkę od cytatów.</main>
</>
);

View File

@@ -35,6 +35,7 @@ const PageMe = () => {
return (
<>
<SEO title="twój profil" dontindex />
{isLoading && (
<main>
<h3>Ładujemy dane dla Ciebie...</h3>
@@ -51,7 +52,6 @@ const PageMe = () => {
)}
{!isLoading && !error && user && (
<main>
<SEO title="twój profil" />
<ProfileCard
data={{
username: user.name || "unknown user",

View File

@@ -7,6 +7,7 @@ const PageMeSettings = () => {
return (
<>
<SEO dontindex title="ustawienia konta" />
{isLoading && (
<>
<main>

View File

@@ -31,7 +31,12 @@ const ProfilePage = () => {
});
}, []);
if (loading) {
return <main style={{ color: "grey" }}>Fetching data...</main>;
return (
<>
<SEO dontindex />
<main style={{ color: "grey" }}>Fetching data...</main>
</>
);
} else {
if (
persons
@@ -45,38 +50,11 @@ const ProfilePage = () => {
})[0];
return (
<>
<SEO title={person.Name} />
{/* <main>
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
gap: "1rem",
margin: "2rem 0 0 0",
}}
>
<img
src={person.Img}
alt={`${person.Name} profile image`}
style={{
width: "128px",
aspectRatio: "1/1",
objectFit: "cover",
borderRadius: "50%",
}}
/>
<div>
<h1>{person.Name}</h1>
<p>{person.Desc}</p>
</div>
</div> */}
{/* FOR LATER BIGDESC DATASET */}
{/* {person.profile?.bigdesc.map((el, index) => {
return <p key={index}>{el || <br />}</p>;
})} */}
{/* </main> */}
<SEO
title={person.Name}
description={person.Desc}
picture={person.Img}
/>
<main>
<ProfileCard
data={{
@@ -106,7 +84,7 @@ const ProfilePage = () => {
} else {
return (
<main>
<SEO title="nieznany profil" />
<SEO title="nieznany profil" dontindex />
<h1>Sorki!{" :("}</h1>
<p style={{ lineHeight: "30px" }}>
Sprawdź pisownię:

View File

@@ -1,9 +1,10 @@
import { SEO } from "../components/SEO";
const PageRankingi = () => {
const SEOdesc = `Strona w trakcie budowy - rankingi wiadomości i danych wśród użytkowników gractwa!`;
return (
<>
<SEO title="rankingi" />
<SEO title="rankingi" description={SEOdesc} />
<main>Miejsce na stronkę od rankingów.</main>
</>
);