Skip to content

Commit 9d8ecce

Browse files
committed
fix metadata base to set proper canonical urls (#5613)
fixes: DASH-492 <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `metadata` in the `layout.tsx` file and modifying the sitemap configuration in `next-sitemap.config.js` to improve SEO and access control based on the environment. ### Detailed summary - In `layout.tsx`: - Added `metadataBase` with URL `https://thirdweb.com`. - Introduced `alternates` with a `canonical` path set to `"./"`. - In `next-sitemap.config.js`: - Updated access rules: - Allowed access if `VERCEL_ENV` is `"production"`. - Disallowed access to all if not in production, except for specific paths (`/team` and `/team/*`). > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent e767029 commit 9d8ecce

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

apps/dashboard/next-sitemap.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ module.exports = {
4848
policies: [
4949
{
5050
userAgent: "*",
51-
[process.env.VERCEL_ENV !== "preview" &&
52-
process.env.VERCEL_ENV !== "development"
53-
? "allow"
54-
: "disallow"]: "/",
51+
// allow all if production
52+
allow: process.env.VERCEL_ENV === "production" ? ["/"] : [],
53+
// disallow all if not production
54+
disallow:
55+
process.env.VERCEL_ENV !== "production"
56+
? ["/"]
57+
: // disallow `/team` and `/team/*` if production
58+
["/team", "/team/*"],
5559
},
5660
],
5761
},

apps/dashboard/src/app/layout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const fontSans = Inter({
1717
});
1818

1919
export const metadata: Metadata = {
20+
metadataBase: new URL("https://thirdweb.com"),
21+
alternates: {
22+
canonical: "./",
23+
},
2024
title: "thirdweb: The complete web3 development platform",
2125
description:
2226
"Build web3 apps easily with thirdweb's powerful SDKs, audited smart contracts, and developer tools—for Ethereum & 700+ EVM chains. Try now.",

0 commit comments

Comments
 (0)