Skip to content

Commit 1634885

Browse files
committed
new change
1 parent ecb9d2d commit 1634885

247 files changed

Lines changed: 9230 additions & 15345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

README.mdx

Lines changed: 0 additions & 68 deletions
This file was deleted.

big.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
3+
4+
export const bigRoutes=[
5+
'curation',
6+
'draftkit-tutorial',
7+
'learn'
8+
]
9+
export type Compose ={
10+
lang: string,
11+
bigRoute: string,
12+
slug: string
13+
}
14+
export function extractBigRoutes(path: string){
15+
const segments = path.split('/').filter(Boolean) // loại bỏ phần rỗng do dấu '/' //b1: cái segments[1] là lang
16+
17+
if (segments.length < 2) return null // phải có lang + bigRoute
18+
19+
const lang = segments[0]
20+
21+
// dò bigRoute bằng cách kiểm tra từng route trong bigRoutes
22+
for (const route of bigRoutes) {
23+
const routeSegments = route.split('/')
24+
const candidate = segments.slice(1, 1 + routeSegments.length).join('/')
25+
26+
if (candidate === route) {
27+
const slug = segments.slice(1 + routeSegments.length).join('/')
28+
return {
29+
lang,
30+
bigRoute: route,
31+
slug,
32+
}
33+
}
34+
}
35+
return null // không khớp route nào
36+
37+
}
38+
39+
40+
console.log(extractBigRoutes('/vi/learn/docs/abc'))

dictionaries/en.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

dictionaries/vi.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
{
15+
ignores: [
16+
"node_modules/**",
17+
".next/**",
18+
"out/**",
19+
"build/**",
20+
"next-env.d.ts",
21+
],
22+
},
23+
];
24+
25+
export default eslintConfig;

input.html

Lines changed: 0 additions & 8 deletions
This file was deleted.

next.config.mjs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import createMDX from "@next/mdx";
2-
import rehypeStringify from 'rehype-stringify'
3-
import remarkParse from 'remark-parse'
4-
import remarkRehype from 'remark-rehype'
5-
import rehypeTypst from "@myriaddreamin/rehype-typst";
6-
import remarkMermaid from "remark-mermaidjs";
72
import rehypeShiki from "@shikijs/rehype";
83
import remarkMath from 'remark-math'
9-
import remarkGfm from 'remark-gfm'
4+
import rehypeTypst from "@myriaddreamin/rehype-typst";
105

116
/** @type {import('next').NextConfig} */
127
const nextConfig = {
@@ -25,7 +20,7 @@ if (process.env.NODE_ENV === "production") {
2520
const withMDX = createMDX({
2621
extension: /\.mdx?$/,
2722
options: {
28-
remarkPlugins: [remarkGfm, remarkMath, remarkMermaid],
23+
remarkPlugins: [remarkMath, ],
2924
rehypePlugins: [
3025
rehypeTypst,
3126
[

output.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)