Skip to content

Commit

Permalink
test link previews
Browse files Browse the repository at this point in the history
  • Loading branch information
shrey150 committed Sep 15, 2024
1 parent 2f8443f commit 97a97c5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"axios": "^0.21.1",
"formik": "^2.2.9",
"https": "^1.0.0",
"next": "latest",
"next": "^12.0.0",
"postcss": "^8.4.7",
"prop-types": "^15.7.2",
"react": "^16.13.1",
Expand Down
51 changes: 47 additions & 4 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NextPage } from "next";
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
import Head from "next/head";
import Redirect from "../components/Redirect";
import supabase from "../utils/supabaseClient";

Expand All @@ -15,9 +16,6 @@ const DynamicLink: NextPage = () => {
const slug = router.query.slug as string[];
const [route, setRoute] = useState<string>("");

// * Todo: Need to consider if slug is an array of multiple directories
// * ie -> v1michigan.com/<name>/<name2>, currently we only support v1michigan.com/<name>

useEffect(() => {
const fetchData = async () => {
// NextJS routes to an empty slug before going to slug.
Expand All @@ -44,7 +42,52 @@ const DynamicLink: NextPage = () => {
fetchData();
}, [slug]);

return route ? <Redirect route={route} /> : null;
return route ? (
<div>
<Head>
<title>V1’s Recruiting Playbook | Notion</title>
<meta
name="description"
content="Hi everyone! This guide will be curated by Dev Kunjadia on how to recruit for software engineering internships and full time offers! Contact me at devk@umich.edu if you have any suggestions."
/>

<meta
property="og:url"
content="https://v1community.notion.site/V1-s-Recruiting-Playbook-0f12927af1e9457787c27f43e325685c"
/>
<meta property="og:type" content="website" />
<meta property="og:title" content="V1’s Recruiting Playbook | Notion" />
<meta
property="og:description"
content="Hi everyone! This guide will be curated by Dev Kunjadia on how to recruit for software engineering internships and full time offers! Contact me at devk@umich.edu if you have any suggestions."
/>
<meta
property="og:image"
content="https://v1community.notion.site/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fc5808856-ccf9-4316-8b86-323de7039901%2F08ae5676-95bd-4a2d-8807-48eba14c7c7f%2FSocialMediaPreviewImage.png?table=block&id=0f12927a-f1e9-4577-87c2-7f43e325685c&spaceId=c5808856-ccf9-4316-8b86-323de7039901&width=2000&userId=&cache=v2"
/>

<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="v1community.notion.site" />
<meta
property="twitter:url"
content="https://v1community.notion.site/V1-s-Recruiting-Playbook-0f12927af1e9457787c27f43e325685c"
/>
<meta
name="twitter:title"
content="V1’s Recruiting Playbook | Notion"
/>
<meta
name="twitter:description"
content="Hi everyone! This guide will be curated by Dev Kunjadia on how to recruit for software engineering internships and full time offers! Contact me at devk@umich.edu if you have any suggestions."
/>
<meta
name="twitter:image"
content="https://v1community.notion.site/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fc5808856-ccf9-4316-8b86-323de7039901%2F08ae5676-95bd-4a2d-8807-48eba14c7c7f%2FSocialMediaPreviewImage.png?table=block&id=0f12927a-f1e9-4577-87c2-7f43e325685c&spaceId=c5808856-ccf9-4316-8b86-323de7039901&width=2000&userId=&cache=v2"
/>
</Head>
<Redirect route={route} />
</div>
) : null;
};

export default DynamicLink;

0 comments on commit 97a97c5

Please sign in to comment.