Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix: meta tags & page titles

AykutSaracb3f3d0718841
diff --git a/src/components/SeoTags/index.tsx b/src/components/SeoTags/index.tsx
deleted file mode 100644
index c5f94d0a..00000000
--- a/src/components/SeoTags/index.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from "react";
-
-interface SeoTagsProps {
- title: string;
- description: string;
- image: string;
-}
-
-export const SeoTags: React.FC<SeoTagsProps> = ({ description, title, image }) => (
- <>
- <meta name="description" content={description} />
-
- {/* <!-- Facebook Meta Tags --> */}
- <meta property="og:url" content="https://jsoncrack.com" />
- <meta property="og:type" content="website" />
- <meta property="og:title" content={title} />
- <meta property="og:description" content={description} />
- <meta property="og:image" content={image} />
-
- {/* <!-- Twitter Meta Tags --> */}
- <meta name="twitter:card" content="summary_large_image" />
- <meta property="twitter:domain" content="https://jsoncrack.com" />
- <meta property="twitter:url" content="https://jsoncrack.com" />
- <meta name="twitter:title" content={title} />
- <meta name="twitter:description" content={description} />
- <meta name="twitter:image" content={image} />
- </>
-);
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
index 6a560641..1d99be13 100644
--- a/src/pages/404.tsx
+++ b/src/pages/404.tsx
@@ -8,6 +8,7 @@ const NotFound: React.FC = () => {
return (
<Layout>
<Head>
+ <title>404 | JSON Crack</title>
<meta name="robots" content="noindex,nofollow" />
</Head>
<Stack mt={100} justify="center" align="center">
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 708397cb..66b19280 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,6 +1,7 @@
import React from "react";
import type { AppProps } from "next/app";
import dynamic from "next/dynamic";
+import Head from "next/head";
import { useRouter } from "next/router";
import { MantineProvider, createTheme } from "@mantine/core";
import "@mantine/core/styles.css";
@@ -54,31 +55,36 @@ function JsonCrack({
}, [router.events]);
return (
- <SessionContextProvider supabaseClient={supabase}>
- <MantineProvider theme={mantineTheme}>
- <ThemeProvider theme={lightTheme}>
- <GlobalStyle />
- <Component {...pageProps} />
- <ModalController />
- <Toaster
- position="bottom-right"
- containerStyle={{
- bottom: 34,
- right: 8,
- fontSize: 14,
- }}
- toastOptions={{
- style: {
- background: "#4D4D4D",
- color: "#B9BBBE",
- borderRadius: 4,
- },
- }}
- />
- <ExternalMode />
- </ThemeProvider>
- </MantineProvider>
- </SessionContextProvider>
+ <>
+ <Head>
+ <title>JSON Crack | Visualize Instantly Into Graphs</title>
+ </Head>
+ <SessionContextProvider supabaseClient={supabase}>
+ <MantineProvider theme={mantineTheme}>
+ <ThemeProvider theme={lightTheme}>
+ <GlobalStyle />
+ <Component {...pageProps} />
+ <ModalController />
+ <Toaster
+ position="bottom-right"
+ containerStyle={{
+ bottom: 34,
+ right: 8,
+ fontSize: 14,
+ }}
+ toastOptions={{
+ style: {
+ background: "#4D4D4D",
+ color: "#B9BBBE",
+ borderRadius: 4,
+ },
+ }}
+ />
+ <ExternalMode />
+ </ThemeProvider>
+ </MantineProvider>
+ </SessionContextProvider>
+ </>
);
}
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index a1c0ce1e..b130eaa8 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -7,7 +7,13 @@ import Document, {
DocumentInitialProps,
} from "next/document";
import { ServerStyleSheet } from "styled-components";
-import { SeoTags } from "src/components/SeoTags";
+
+const metatags = Object.freeze({
+ description:
+ "JSON Crack Editor is a tool for visualizing into graphs, analyzing, editing, formatting, querying, transforming and validating JSON, CSV, YAML, XML, and more.",
+ title: "JSON Crack - Visualize Data to Graphs",
+ image: "https://jsoncrack.com/assets/jsoncrack.png",
+});
class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
@@ -40,14 +46,22 @@ class MyDocument extends Document {
return (
<Html lang="en">
<Head>
- <SeoTags
- description="JSON Crack Editor is a tool for visualizing into graphs, analyzing, editing, formatting, querying, transforming and validating JSON, CSV, YAML, XML, and more."
- title="JSON Crack - Visualize Data to Graphs"
- image="https://jsoncrack.com/assets/jsoncrack.png"
- />
<meta name="theme-color" content="#36393E" />
<link rel="manifest" href="/manifest.json" />
<link rel="icon" href="/favicon.ico" />
+
+ <meta name="description" content={metatags.description} key="description" />
+ <meta property="og:url" content="https://jsoncrack.com" key="ogurl" />
+ <meta property="og:type" content="website" key="ogtype" />
+ <meta property="og:title" content={metatags.title} key="ogtitle" />
+ <meta property="og:description" content={metatags.description} key="ogdescription" />
+ <meta property="og:image" content={metatags.image} key="ogimage" />
+ <meta name="twitter:card" content="summary_large_image" key="twcard" />
+ <meta property="twitter:domain" content="https://jsoncrack.com" key="twdomain" />
+ <meta property="twitter:url" content="https://jsoncrack.com" key="twurl" />
+ <meta name="twitter:title" content={metatags.title} key="twtitle" />
+ <meta name="twitter:description" content={metatags.description} key="twdescription" />
+ <meta name="twitter:image" content={metatags.image} key="twimage" />
</Head>
<body>
<Main />
diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx
index cf4487ea..b6b232fc 100644
--- a/src/pages/_error.tsx
+++ b/src/pages/_error.tsx
@@ -10,6 +10,7 @@ const Custom500 = () => {
return (
<Layout>
<Head>
+ <title>Unexpected Error Occured | JSON Crack</title>
<meta name="robots" content="noindex,nofollow" />
</Head>
<Stack mt={100} justify="center" align="center">
diff --git a/src/pages/sign-up.tsx b/src/pages/sign-up.tsx
index 9c475f97..061e2e03 100644
--- a/src/pages/sign-up.tsx
+++ b/src/pages/sign-up.tsx
@@ -57,7 +57,7 @@ const SignUp = () => {
return (
<Layout>
<Head>
- <title>JSON Crack | Sign Up</title>
+ <title>Sign Up - JSON Crack</title>
</Head>
{done ? (
<Paper mx="auto" maw={400} mt={50} p="lg" withBorder>