Skip to content

Commit

Permalink
chore: cleanUrls, rewrite to /docs/
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-perkins committed Nov 15, 2023
1 parent 9015c1b commit ffd0451
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,14 @@ export function useAlternatePageUtils(): {
baseUrl,
});

const formattedBaseUrl = applyTrailingSlash(baseUrl, {
trailingSlash,
baseUrl,
});

const baseUrlUnlocalized = currentLocale === defaultLocale ? baseUrl : baseUrl.replace(`/${currentLocale}/`, '/');

const pathnameSuffix = canonicalPathname.replace(formattedBaseUrl, '');
const pathnameSuffix = canonicalPathname.replace(baseUrl, '');

console.log('pathNameSuffix', {
pathnameSuffix,
canonicalPathname,
baseUrl,
formattedBaseUrl,
});

function getLocalizedBaseUrl(locale: string) {
Expand Down
3 changes: 2 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"trailingSlash": false,
"cleanUrls": true,
"redirects": [
{ "source": "/", "destination": "/docs/" },
{
Expand Down Expand Up @@ -68,7 +69,7 @@
{ "source": "/docs/react/testing", "destination": "/docs/react/testing/introduction" }
],
"rewrites": [
{ "source": "/docs", "destination": "/" },
{ "source": "/docs/", "destination": "/" },
{ "source": "/docs/:match*", "destination": "/:match*" }
]
}

0 comments on commit ffd0451

Please sign in to comment.