From 75a3946788ead6023372a6e4cec801167352408b Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:43:28 +0000 Subject: [PATCH] deal with search engines indexing --- app/root.tsx | 15 +++++++++++---- app/utils/env.server.ts | 10 +++++++++- server.js | 8 ++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 8e17b4e..6e55131 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -16,7 +16,11 @@ import { import { NavBar } from "#app/components/navbar/index.tsx"; import { Footer } from "#app/components/footer.tsx"; import clsx from "clsx"; -import { publicEnv, forceEnvValidation } from "#app/utils/env.server.ts"; +import { + publicEnv, + forceEnvValidation, + type PublicEnv, +} from "#app/utils/env.server.ts"; import { FaviconMeta, faviconLinks } from "#app/utils/favicon.tsx"; import { useNonce } from "./utils/nonce-provider.tsx"; import { ClientHintsCheck, getHints } from "./utils/client-hints.tsx"; @@ -92,12 +96,12 @@ function Document({ children, nonce, theme = "light", - env = {}, + env, }: { children: React.ReactNode; nonce: string; theme?: Theme; - env?: Record; + env?: PublicEnv; }) { return ( @@ -105,6 +109,9 @@ function Document({ + {!env?.ALLOW_INDEXING && ( + + )} @@ -118,7 +125,7 @@ function Document({