Skip to content

Commit 525e603

Browse files
committed
Add support for additional languages in Framer rewrites (#6828)
closes: TOOL-4244 # Add support for additional languages in Framer rewrites This PR adds support for additional languages in the Framer rewrite paths. It introduces a new constant `FRAMER_ADDITIONAL_LANGUAGES` with Spanish ("es") as the initial additional language. The rewrites configuration has been updated to: - Keep the existing English paths - Generate additional paths for each language in the format `/{lang}{path}` - Direct these paths to the corresponding landing page URLs This change enables proper routing for localized landing pages.
1 parent 4baefa5 commit 525e603

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

apps/dashboard/next.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ const SENTRY_OPTIONS: SentryBuildOptions = {
111111
automaticVercelMonitors: false,
112112
};
113113

114+
// add additional languages to the framer rewrite paths here (english is already included by default)
115+
const FRAMER_ADDITIONAL_LANGUAGES = ["es"];
116+
114117
const baseNextConfig: NextConfig = {
115118
eslint: {
116119
ignoreDuringBuilds: true,
@@ -155,10 +158,18 @@ const baseNextConfig: NextConfig = {
155158
source: "/home",
156159
destination: "https://landing.thirdweb.com",
157160
},
158-
...FRAMER_PATHS.map((path) => ({
159-
source: path,
160-
destination: `https://landing.thirdweb.com${path}`,
161-
})),
161+
// flatmap the framer paths for the default language and the additional languages
162+
...FRAMER_PATHS.flatMap((path) => [
163+
{
164+
source: path,
165+
destination: `https://landing.thirdweb.com${path}`,
166+
},
167+
// this is for additional languages
168+
...FRAMER_ADDITIONAL_LANGUAGES.map((lang) => ({
169+
source: `/${lang}${path}`,
170+
destination: `https://landing.thirdweb.com/${lang}${path}`,
171+
})),
172+
]),
162173
];
163174
},
164175
images: {

0 commit comments

Comments
 (0)