docs: improve redirects (#381)

* style: format code style

* chore: upgrade next.js
This commit is contained in:
witt
2020-09-02 10:58:44 +08:00
committed by GitHub
parent c126371b2b
commit dd8c95d561
10 changed files with 300 additions and 360 deletions

View File

@@ -24,9 +24,7 @@ describe('Avatar', () => {
}) })
it('stacked should be work', () => { it('stacked should be work', () => {
const avatar = shallow( const avatar = shallow(<Avatar src="/images/avatar.png" stacked />)
<Avatar src="/images/avatar.png" stacked />,
)
expect(() => avatar.unmount()).not.toThrow() expect(() => avatar.unmount()).not.toThrow()
}) })

View File

@@ -21,38 +21,45 @@ const nextConfig = {
VERSION: require('./package.json').version, VERSION: require('./package.json').version,
}, },
trailingSlash: false,
experimental: { experimental: {
reactStrictMode: true, reactStrictMode: true,
},
redirects() { async redirects() {
return [ return [
{ {
source: '/docs/getting-started/:path*', source: '/docs/getting-started/:path*',
permanent: true, permanent: true,
destination: '/en-us/guide/:path*', destination: '/en-us/guide/:path*',
}, },
{ {
source: '/en-us/getting-started/:path*', source: '/en-us/getting-started/:path*',
permanent: true, permanent: true,
destination: '/en-us/guide/:path*', destination: '/en-us/guide/:path*',
}, },
{ {
source: '/zh-cn/getting-started/:path*', source: '/zh-cn/getting-started/:path*',
permanent: true, permanent: true,
destination: '/zh-cn/guide/:path*', destination: '/zh-cn/guide/:path*',
}, },
{ {
source: '/zh-cn/', source: '/zh-cn',
permanent: true, permanent: true,
destination: '/zh-cn', destination: '/zh-cn/guide/introduction',
}, },
{ {
source: '/en-us/', source: '/en-us',
permanent: true, permanent: true,
destination: '/en-us', destination: '/en-us/guide/introduction',
}, },
] {
}, source: '/',
permanent: true,
destination: '/en-us',
},
]
}, },
} }

View File

@@ -77,7 +77,7 @@
"extract-mdx-metadata": "^1.0.0", "extract-mdx-metadata": "^1.0.0",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"jest": "^25.3.0", "jest": "^25.3.0",
"next": "^9.4.0", "next": "^9.5.3",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"react": "^16.13.1", "react": "^16.13.1",
"react-color": "^2.18.0", "react-color": "^2.18.0",

View File

@@ -128,11 +128,7 @@ interface ToastAction {
<Attributes.Title>NormalTypes</Attributes.Title> <Attributes.Title>NormalTypes</Attributes.Title>
```ts ```ts
type NormalTypes = 'default' type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
| 'secondary'
| 'success'
| 'warning'
| 'error'
``` ```
</Attributes> </Attributes>

View File

@@ -1,3 +0,0 @@
import redirect from 'lib/redirect'
export default redirect('/en-us/guide/introduction')

View File

@@ -1,3 +0,0 @@
import redirect from 'lib/redirect'
export default redirect('/en-us')

View File

@@ -121,7 +121,6 @@ export const meta = {
`} `}
/> />
<Attributes edit="/pages/zh-cn/components/textarea.mdx"> <Attributes edit="/pages/zh-cn/components/textarea.mdx">
<Attributes.Title alias="Input.Textarea">Textarea.Props</Attributes.Title> <Attributes.Title alias="Input.Textarea">Textarea.Props</Attributes.Title>

View File

@@ -128,14 +128,9 @@ interface ToastAction {
<Attributes.Title>NormalTypes</Attributes.Title> <Attributes.Title>NormalTypes</Attributes.Title>
```ts ```ts
type NormalTypes = 'default' type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
| 'secondary'
| 'success'
| 'warning'
| 'error'
``` ```
</Attributes> </Attributes>
export default ({ children }) => <Layout meta={meta}>{children}</Layout> export default ({ children }) => <Layout meta={meta}>{children}</Layout>

View File

@@ -1,3 +0,0 @@
import redirect from 'lib/redirect'
export default redirect('/zh-cn/guide/introduction')

566
yarn.lock

File diff suppressed because it is too large Load Diff