🚩 create HTML meta tag helper
This commit is contained in:
@ -1,6 +1,13 @@
|
|||||||
|
import { buildMeta } from "@/shared/config/meta";
|
||||||
import LoginCard from "@/widgets/authentication/login/LoginCard";
|
import LoginCard from "@/widgets/authentication/login/LoginCard";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
export const generateMetadata = () => {
|
||||||
|
return buildMeta({
|
||||||
|
title: "Log in",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const page = () => {
|
const page = () => {
|
||||||
return (
|
return (
|
||||||
<div className="fixed z-10 w-screen h-screen flex justify-center items-center -mt-12">
|
<div className="fixed z-10 w-screen h-screen flex justify-center items-center -mt-12">
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
|
import { buildMeta } from "@/shared/config/meta";
|
||||||
import SignupCard from "@/widgets/authentication/signup/SignupCard";
|
import SignupCard from "@/widgets/authentication/signup/SignupCard";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
export const generateMetadata = () => {
|
||||||
|
return buildMeta({
|
||||||
|
title: "Sign in",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const page = () => {
|
const page = () => {
|
||||||
return (
|
return (
|
||||||
<div className="fixed z-10 w-screen h-screen flex justify-center items-center -mt-12">
|
<div className="fixed z-10 w-screen h-screen flex justify-center items-center -mt-12">
|
||||||
|
|||||||
29
shared/config/meta.ts
Normal file
29
shared/config/meta.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
type BuildMeta = {
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
image?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const appName = process.env.APP_NAME;
|
||||||
|
export const defaultMeta = {
|
||||||
|
title: appName || "Unknown App",
|
||||||
|
description: "Interactive community",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildMeta = ({ title, description, image }: BuildMeta) => {
|
||||||
|
return {
|
||||||
|
title: title ? `${title} - ${appName}` : defaultMeta.title,
|
||||||
|
description: description || defaultMeta.description,
|
||||||
|
openGraph: {
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
images: image ? [image] : ["/default-og.png"],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: "summary_large_image",
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
images: image ? [image] : ["/default-og.png"],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user