From bc5af50b0ccd92dea103a74144b087d9006dc01b Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Thu, 6 Oct 2022 13:49:39 -0700 Subject: [PATCH] unindex date-docs from search engines --- web/components/NoSEO.tsx | 10 ++++++++++ web/pages/date-docs/[username].tsx | 2 ++ web/pages/date-docs/create.tsx | 2 ++ web/pages/date-docs/index.tsx | 2 ++ 4 files changed, 16 insertions(+) create mode 100644 web/components/NoSEO.tsx diff --git a/web/components/NoSEO.tsx b/web/components/NoSEO.tsx new file mode 100644 index 00000000..f72907c8 --- /dev/null +++ b/web/components/NoSEO.tsx @@ -0,0 +1,10 @@ +import Head from "next/head"; + +/** Exclude page from search results */ +export function NoSEO() { + return ( + + + + ) +} \ No newline at end of file diff --git a/web/pages/date-docs/[username].tsx b/web/pages/date-docs/[username].tsx index 350e79b7..dd7d5d73 100644 --- a/web/pages/date-docs/[username].tsx +++ b/web/pages/date-docs/[username].tsx @@ -22,6 +22,7 @@ import { PostCommentsActivity, RichEditPost } from '../post/[...slugs]' import { usePost } from 'web/hooks/use-post' import { useTipTxns } from 'web/hooks/use-tip-txns' import { useCommentsOnPost } from 'web/hooks/use-comments' +import { NoSEO } from 'web/components/NoSEO' export async function getStaticProps(props: { params: { username: string } }) { const { username } = props.params @@ -62,6 +63,7 @@ function DateDocPage(props: { creator: User; post: DateDoc }) { return ( + diff --git a/web/pages/date-docs/create.tsx b/web/pages/date-docs/create.tsx index 08442cc1..ed1df677 100644 --- a/web/pages/date-docs/create.tsx +++ b/web/pages/date-docs/create.tsx @@ -14,6 +14,7 @@ import dayjs from 'dayjs' import { MINUTE_MS } from 'common/util/time' import { Col } from 'web/components/layout/col' import { MAX_QUESTION_LENGTH } from 'common/contract' +import { NoSEO } from 'web/components/NoSEO' export default function CreateDateDocPage() { const user = useUser() @@ -64,6 +65,7 @@ export default function CreateDateDocPage() { return ( +
diff --git a/web/pages/date-docs/index.tsx b/web/pages/date-docs/index.tsx index 9ddeb57f..48e0bb13 100644 --- a/web/pages/date-docs/index.tsx +++ b/web/pages/date-docs/index.tsx @@ -12,6 +12,7 @@ import { Button } from 'web/components/button' import { SiteLink } from 'web/components/site-link' import { getUser, User } from 'web/lib/firebase/users' import { DateDocPost } from './[username]' +import { NoSEO } from 'web/components/NoSEO' export async function getStaticProps() { const dateDocs = await getDateDocs() @@ -40,6 +41,7 @@ export default function DatePage(props: { return ( +