Skip to content

Commit ceae878

Browse files
committed
Refactor routes
1 parent 7b0c37c commit ceae878

File tree

90 files changed

+212
-503
lines changed

Some content is hidden

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

90 files changed

+212
-503
lines changed

apps/landing/script.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ const files = await glob('src/**/*.mdx')
55
const q = []
66
for await (const file of files) {
77
q.push(
8-
readFile(file).then((content) => {
8+
readFile(file, {
9+
encoding: 'utf-8',
10+
}).then((content) => {
911
const titleIndex = content.toString().indexOf('#')
12+
if (content.trim().length === 0) {
13+
return null
14+
}
15+
const fileName = file.split(/[/\\]/).pop()
16+
1017
return {
1118
text: content.toString().substring(titleIndex),
12-
title: /# (.*)/.exec(content.toString())[1],
13-
url:
14-
'/devup-ui/' +
15-
file
16-
.replace(/src[/\\]app[/\\]\(detail\)[/\\]/, '')
17-
.replace('page.mdx', ''),
19+
title: /(#)+ (.*)/.exec(content.toString())[1],
20+
url: file
21+
.replace(/src[/\\]app[/\\]\(detail\)[/\\]/, '')
22+
.replace(fileName, ''),
1823
}
1924
}),
2025
)

apps/landing/src/app/(detail)/components/MdxCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default async function MdxCard({
2020
const content = await readFile(
2121
join(
2222
process.cwd(),
23-
'src/app/(detail)/components',
23+
'src/app/(detail)/components/[component]',
2424
src ?? 'button/demo/Variants.tsx',
2525
),
2626
{

apps/landing/src/app/(detail)/components/button/IconDelete.tsx renamed to apps/landing/src/app/(detail)/components/[component]/IconDelete.tsx

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions

apps/landing/src/app/(detail)/components/button/Api.mdx renamed to apps/landing/src/app/(detail)/components/[component]/button/Api.mdx

apps/landing/src/app/(detail)/components/button/demo/Colors.tsx renamed to apps/landing/src/app/(detail)/components/[component]/button/demo/Colors.tsx

File renamed without changes.

apps/landing/src/app/(detail)/components/button/demo/Danger.tsx renamed to apps/landing/src/app/(detail)/components/[component]/button/demo/Danger.tsx

File renamed without changes.

apps/landing/src/app/(detail)/components/button/demo/Disabled.tsx renamed to apps/landing/src/app/(detail)/components/[component]/button/demo/Disabled.tsx

File renamed without changes.

apps/landing/src/app/(detail)/components/button/demo/Icon.tsx renamed to apps/landing/src/app/(detail)/components/[component]/button/demo/Icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Button } from '@devup-ui/components'
22
import { Box, css, Flex } from '@devup-ui/react'
33

4-
import IconDelete from '../IconDelete'
4+
import IconDelete from '../../IconDelete'
55

66
/**
77
* **Icon**

0 commit comments

Comments
 (0)