unindex date-docs from search engines

This commit is contained in:
Sinclair Chen 2022-10-06 13:49:39 -07:00
parent 4162cca3ff
commit bc5af50b0c
4 changed files with 16 additions and 0 deletions

10
web/components/NoSEO.tsx Normal file
View File

@ -0,0 +1,10 @@
import Head from "next/head";
/** Exclude page from search results */
export function NoSEO() {
return (
<Head>
<meta name="robots" content="noindex,follow"/>
</Head>
)
}

View File

@ -22,6 +22,7 @@ import { PostCommentsActivity, RichEditPost } from '../post/[...slugs]'
import { usePost } from 'web/hooks/use-post' import { usePost } from 'web/hooks/use-post'
import { useTipTxns } from 'web/hooks/use-tip-txns' import { useTipTxns } from 'web/hooks/use-tip-txns'
import { useCommentsOnPost } from 'web/hooks/use-comments' import { useCommentsOnPost } from 'web/hooks/use-comments'
import { NoSEO } from 'web/components/NoSEO'
export async function getStaticProps(props: { params: { username: string } }) { export async function getStaticProps(props: { params: { username: string } }) {
const { username } = props.params const { username } = props.params
@ -62,6 +63,7 @@ function DateDocPage(props: { creator: User; post: DateDoc }) {
return ( return (
<Page> <Page>
<NoSEO />
<Col className="mx-auto w-full max-w-xl gap-6 sm:mb-6"> <Col className="mx-auto w-full max-w-xl gap-6 sm:mb-6">
<SiteLink href="/date-docs"> <SiteLink href="/date-docs">
<Row className="items-center gap-2"> <Row className="items-center gap-2">

View File

@ -14,6 +14,7 @@ import dayjs from 'dayjs'
import { MINUTE_MS } from 'common/util/time' import { MINUTE_MS } from 'common/util/time'
import { Col } from 'web/components/layout/col' import { Col } from 'web/components/layout/col'
import { MAX_QUESTION_LENGTH } from 'common/contract' import { MAX_QUESTION_LENGTH } from 'common/contract'
import { NoSEO } from 'web/components/NoSEO'
export default function CreateDateDocPage() { export default function CreateDateDocPage() {
const user = useUser() const user = useUser()
@ -64,6 +65,7 @@ export default function CreateDateDocPage() {
return ( return (
<Page> <Page>
<NoSEO />
<div className="mx-auto w-full max-w-3xl"> <div className="mx-auto w-full max-w-3xl">
<div className="rounded-lg px-6 py-4 pb-4 sm:py-0"> <div className="rounded-lg px-6 py-4 pb-4 sm:py-0">
<Row className="mb-8 items-center justify-between"> <Row className="mb-8 items-center justify-between">

View File

@ -12,6 +12,7 @@ import { Button } from 'web/components/button'
import { SiteLink } from 'web/components/site-link' import { SiteLink } from 'web/components/site-link'
import { getUser, User } from 'web/lib/firebase/users' import { getUser, User } from 'web/lib/firebase/users'
import { DateDocPost } from './[username]' import { DateDocPost } from './[username]'
import { NoSEO } from 'web/components/NoSEO'
export async function getStaticProps() { export async function getStaticProps() {
const dateDocs = await getDateDocs() const dateDocs = await getDateDocs()
@ -40,6 +41,7 @@ export default function DatePage(props: {
return ( return (
<Page> <Page>
<NoSEO />
<div className="mx-auto w-full max-w-xl"> <div className="mx-auto w-full max-w-xl">
<Row className="items-center justify-between p-4 sm:p-0"> <Row className="items-center justify-between p-4 sm:p-0">
<Title className="!my-0 px-2 text-blue-500" text="Date docs" /> <Title className="!my-0 px-2 text-blue-500" text="Date docs" />