Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

Add seo (#363)

Luke Vella08d70262bbbb
diff --git a/package.json b/package.json
index efaff1260..23a29109f 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"next": "^12.2.2",
"next-i18next": "^10.5.0",
"next-plausible": "^3.1.9",
+ "next-seo": "^5.14.1",
"nodemailer": "^6.7.2",
"prisma": "^4.1.0",
"react": "17.0.2",
@@ -59,7 +60,7 @@
"zod": "^3.16.0"
},
"devDependencies": {
- "@playwright/test": "^1.22.2",
+ "@playwright/test": "^1.28.1",
"@types/accept-language-parser": "^1.5.3",
"@types/lodash": "^4.14.178",
"@types/nodemailer": "^6.4.4",
diff --git a/public/og-image-1200.png b/public/og-image-1200.png
new file mode 100644
index 000000000..265f00499
Binary files /dev/null and b/public/og-image-1200.png differ
diff --git a/src/components/home.tsx b/src/components/home.tsx
index 9e1351d42..5552b5a70 100644
--- a/src/components/home.tsx
+++ b/src/components/home.tsx
@@ -1,5 +1,5 @@
-import Head from "next/head";
import { useTranslation } from "next-i18next";
+import { NextSeo } from "next-seo";
import React from "react";
import Bonus from "./home/bonus";
@@ -11,10 +11,15 @@ const Home: React.VoidFunctionComponent = () => {
const { t } = useTranslation("homepage");
return (
<PageLayout>
- <Head>
- <meta name="description" content={t("metaDescription")} />
- <title>{t("metaTitle")}</title>
- </Head>
+ <NextSeo
+ title={t("metaTitle")}
+ description={t("metaDescription")}
+ twitter={{
+ handle: "@imlukevella",
+ site: "@ralllyco",
+ cardType: "summary_large_image",
+ }}
+ />
<Hero />
<Features />
<Bonus />
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index bf967bcb1..a28a365a5 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -9,12 +9,14 @@ import dynamic from "next/dynamic";
import Head from "next/head";
import { appWithTranslation } from "next-i18next";
import PlausibleProvider from "next-plausible";
+import { DefaultSeo } from "next-seo";
import toast, { Toaster } from "react-hot-toast";
import { MutationCache } from "react-query";
import superjson from "superjson";
import Maintenance from "@/components/maintenance";
+import { absoluteUrl } from "../utils/absolute-url";
import { AppRouter } from "./api/trpc/[trpc]";
const CrispChat = dynamic(() => import("@/components/crisp-chat"), {
@@ -33,6 +35,22 @@ const MyApp: NextPage<AppProps> = ({ Component, pageProps }) => {
selfHosted={true}
enabled={!!process.env.PLAUSIBLE_DOMAIN}
>
+ <DefaultSeo
+ canonical={absoluteUrl()}
+ openGraph={{
+ siteName: "Rallly",
+ url: absoluteUrl(),
+ images: [
+ {
+ url: absoluteUrl("/og-image-1200.png"),
+ width: 1200,
+ height: 630,
+ alt: "Rallly | Schedule group meetings",
+ type: "image/png",
+ },
+ ],
+ }}
+ />
<Head>
<meta
name="viewport"
diff --git a/src/utils/absolute-url.ts b/src/utils/absolute-url.ts
index d4f96c7fb..2385c5e2c 100644
--- a/src/utils/absolute-url.ts
+++ b/src/utils/absolute-url.ts
@@ -4,10 +4,10 @@ const getVercelUrl = () => {
: null;
};
-export function absoluteUrl() {
- return (
+export function absoluteUrl(path = "") {
+ return `${
process.env.NEXT_PUBLIC_BASE_URL ??
getVercelUrl() ??
"http://localhost:3000"
- );
+ }${path}`;
}
diff --git a/style.css b/style.css
index 6c83bd3f7..7152f79bb 100644
--- a/style.css
+++ b/style.css
@@ -32,7 +32,7 @@
@apply outline-none;
}
a {
- @apply rounded-sm font-medium text-primary-500 outline-none hover:text-primary-500 hover:underline hover:no-underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1;
+ @apply rounded-sm font-medium text-primary-500 outline-none hover:text-primary-500 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1;
}
label {
@apply mb-1 block text-sm text-slate-800;
diff --git a/yarn.lock b/yarn.lock
index 359f6117f..941022a75 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1286,13 +1286,13 @@
"@nodelib/fs.scandir" "2.1.4"
fastq "^1.6.0"
-"@playwright/test@^1.22.2":
- version "1.22.2"
- resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.22.2.tgz#b848f25f8918140c2d0bae8e9227a40198f2dd4a"
- integrity sha512-cCl96BEBGPtptFz7C2FOSN3PrTnJ3rPpENe+gYCMx4GNNDlN4tmo2D89y13feGKTMMAIVrXfSQ/UmaQKLy1XLA==
+"@playwright/test@^1.28.1":
+ version "1.28.1"
+ resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.28.1.tgz#e5be297e024a3256610cac2baaa9347fd57c7860"
+ integrity sha512-xN6spdqrNlwSn9KabIhqfZR7IWjPpFK1835tFNgjrlysaSezuX8PYUwaz38V/yI8TJLG9PkAMEXoHRXYXlpTPQ==
dependencies:
"@types/node" "*"
- playwright-core "1.22.2"
+ playwright-core "1.28.1"
"@polka/url@^1.0.0-next.20":
version "1.0.0-next.21"
@@ -4179,6 +4179,11 @@ next-plausible@^3.1.9:
resolved "https://registry.yarnpkg.com/next-plausible/-/next-plausible-3.1.9.tgz#4795df2e83a6ca14495d2fa0d31a92649c42425f"
integrity sha512-6Ro6lVnuXAtqbbBQfuKuu0cpZHWWvJWbOE1G+Rx6i42T6lLYtbQzbu09Cutv3vc/wD/4ySHzJkuTnxsqnlArGA==
+next-seo@^5.14.1:
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-5.14.1.tgz#d07322edc37634fbd9beca51fb04177910d8031c"
+ integrity sha512-NiJeQbxYP3z+EMp52q8k3Q+OfX2+Yv2WehERDj98r2wjXxL+woKpRBdsSVYolTD0Hm8IWs42SzaISE93RoQdOw==
+
next@^12.2.2:
version "12.2.2"
resolved "https://registry.yarnpkg.com/next/-/next-12.2.2.tgz#029bf5e4a18a891ca5d05b189b7cd983fd22c072"
@@ -4505,10 +4510,10 @@ pkg-dir@^2.0.0:
dependencies:
find-up "^2.1.0"
- version "1.22.2"
- resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.22.2.tgz#ed2963d79d71c2a18d5a6fd25b60b9f0a344661a"
- integrity sha512-w/hc/Ld0RM4pmsNeE6aL/fPNWw8BWit2tg+TfqJ3+p59c6s3B6C8mXvXrIPmfQEobkcFDc+4KirNzOQ+uBSP1Q==
+ version "1.28.1"
+ resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.28.1.tgz#8400be9f4a8d1c0489abdb9e75a4cc0ffc3c00cb"
+ integrity sha512-3PixLnGPno0E8rSBJjtwqTwJe3Yw72QwBBBxNoukIj3lEeBNXwbNiKrNuB1oyQgTBw5QHUhNO3SteEtHaMK6ag==
version "11.0.3"