Skip to content

Commit abdc67f

Browse files
committed
move pages one level deeper to handle dynamic [locale] route
1 parent 133e5ca commit abdc67f

32 files changed

+34
-7
lines changed

src/lib/utils/md.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { CONTENT_DIR, DEFAULT_LOCALE, LOCALES_CODES } from "@/lib/constants"
1616

1717
import { toPosixPath } from "./relativePath"
1818

19-
import { ITutorial } from "@/pages/developers/tutorials"
19+
import { ITutorial } from "@/pages/[locale]/developers/tutorials"
2020

2121
function getCurrentDir() {
2222
return join(process.cwd(), CONTENT_DIR)

src/lib/utils/tutorial.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { Lang } from "@/lib/types"
22

33
import { Skill } from "@/components/TutorialMetadata"
44

5-
import { IExternalTutorial, ITutorial } from "@/pages/developers/tutorials"
5+
import {
6+
IExternalTutorial,
7+
ITutorial,
8+
} from "@/pages/[locale]/developers/tutorials"
69

710
// Take all tutorials, and return a list of tutorials for a specific locale
811
export const filterTutorialsByLang = (

src/middleware.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import createMiddleware from "next-intl/middleware"
2+
3+
import { routing } from "./i18n/routing"
4+
5+
export default createMiddleware(routing)
6+
7+
export const config = {
8+
// Skip all paths that should not be internationalized
9+
matcher: ["/((?!api|_next|_vercel|.*\\..*).*)"],
10+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)