feat: add react helmet

This commit is contained in:
2024-01-06 12:35:42 +07:00
parent 5c4dc7244f
commit a13603046c
10 changed files with 129 additions and 15 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ const AppBar = () => {
<Navbar>
<NavbarItem path="/" title="Pet the Furina" />
<NavbarItem path="/furina-beloved" title="Shrimp" />
<NavbarItem path="/toodle" title="Toodle-oo~" />
</Navbar>
</div>
</header>
@@ -0,0 +1,37 @@
import Helmet from "react-helmet";
type PageMetadataProps = {
title?: string;
description?: string;
keywords?: string;
allowIndex?: boolean;
};
const PageMetadata = (props: PageMetadataProps) => {
return (
<Helmet>
<title>{[props.title, "Furina.id"].filter((i) => !!i).join(" - ")}</title>
<meta
name="description"
content={props.description || "Welcome to Furina.id"}
/>
<meta
name="keywords"
content={[
props.keywords,
"furina.id, furina build, furina gameplay, furina guide, furina genshin",
]
.filter((i) => !!i)
.join(", ")}
/>
<meta
name="robots"
content={
props.allowIndex !== false ? "index, follow" : "noindex, nofollow"
}
/>
</Helmet>
);
};
export default PageMetadata;