mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 12:46:38 -04:00
stricter robots.txt
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
import Script from "next/script";
|
||||
|
||||
const Analytics = () => {
|
||||
if (!process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID || process.env.NEXT_PUBLIC_VERCEL_ENV !== "production") {
|
||||
if (process.env.NEXT_PUBLIC_VERCEL_ENV !== "production") {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,7 @@ const robots = (): MetadataRoute.Robots => ({
|
||||
rules: [
|
||||
{
|
||||
userAgent: "*",
|
||||
// block access to staging sites
|
||||
[process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? "allow" : "disallow"]: "/",
|
||||
disallow: ["/_stream/", "/api/", "/stats/", "/tweets/", "/404", "/500"],
|
||||
},
|
||||
],
|
||||
sitemap: `${BASE_URL}/sitemap.xml`,
|
||||
|
@ -15,9 +15,6 @@ const sitemap = async (): Promise<MetadataRoute.Sitemap> => {
|
||||
priority: 1.0,
|
||||
lastModified: new Date(process.env.RELEASE_DATE || Date.now()), // timestamp frozen when a new build is deployed
|
||||
},
|
||||
{ url: `${BASE_URL}/stats` },
|
||||
{ url: `${BASE_URL}/tweets` },
|
||||
{ url: `${BASE_URL}/y2k` },
|
||||
];
|
||||
|
||||
// add each directory in the app folder as a route (excluding special routes)
|
||||
|
Reference in New Issue
Block a user