mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-28 20:25:29 +08:00
docs: improve redirects (#381)
* style: format code style * chore: upgrade next.js
This commit is contained in:
@@ -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()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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',
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
import redirect from 'lib/redirect'
|
|
||||||
|
|
||||||
export default redirect('/en-us/guide/introduction')
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import redirect from 'lib/redirect'
|
|
||||||
|
|
||||||
export default redirect('/en-us')
|
|
||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
import redirect from 'lib/redirect'
|
|
||||||
|
|
||||||
export default redirect('/zh-cn/guide/introduction')
|
|
||||||
Reference in New Issue
Block a user