mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-07 09:09:30 +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', () => {
|
||||
const avatar = shallow(
|
||||
<Avatar src="/images/avatar.png" stacked />,
|
||||
)
|
||||
const avatar = shallow(<Avatar src="/images/avatar.png" stacked />)
|
||||
expect(() => avatar.unmount()).not.toThrow()
|
||||
})
|
||||
|
||||
|
||||
@@ -21,38 +21,45 @@ const nextConfig = {
|
||||
VERSION: require('./package.json').version,
|
||||
},
|
||||
|
||||
trailingSlash: false,
|
||||
|
||||
experimental: {
|
||||
reactStrictMode: true,
|
||||
},
|
||||
|
||||
redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/docs/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/en-us/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/en-us/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/en-us/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/zh-cn/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/zh-cn/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/zh-cn/',
|
||||
permanent: true,
|
||||
destination: '/zh-cn',
|
||||
},
|
||||
{
|
||||
source: '/en-us/',
|
||||
permanent: true,
|
||||
destination: '/en-us',
|
||||
},
|
||||
]
|
||||
},
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/docs/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/en-us/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/en-us/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/en-us/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/zh-cn/getting-started/:path*',
|
||||
permanent: true,
|
||||
destination: '/zh-cn/guide/:path*',
|
||||
},
|
||||
{
|
||||
source: '/zh-cn',
|
||||
permanent: true,
|
||||
destination: '/zh-cn/guide/introduction',
|
||||
},
|
||||
{
|
||||
source: '/en-us',
|
||||
permanent: true,
|
||||
destination: '/en-us/guide/introduction',
|
||||
},
|
||||
{
|
||||
source: '/',
|
||||
permanent: true,
|
||||
destination: '/en-us',
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"extract-mdx-metadata": "^1.0.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"jest": "^25.3.0",
|
||||
"next": "^9.4.0",
|
||||
"next": "^9.5.3",
|
||||
"prettier": "^2.0.5",
|
||||
"react": "^16.13.1",
|
||||
"react-color": "^2.18.0",
|
||||
|
||||
@@ -128,11 +128,7 @@ interface ToastAction {
|
||||
<Attributes.Title>NormalTypes</Attributes.Title>
|
||||
|
||||
```ts
|
||||
type NormalTypes = 'default'
|
||||
| 'secondary'
|
||||
| 'success'
|
||||
| 'warning'
|
||||
| 'error'
|
||||
type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
|
||||
```
|
||||
|
||||
</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.Title alias="Input.Textarea">Textarea.Props</Attributes.Title>
|
||||
|
||||
|
||||
@@ -128,14 +128,9 @@ interface ToastAction {
|
||||
<Attributes.Title>NormalTypes</Attributes.Title>
|
||||
|
||||
```ts
|
||||
type NormalTypes = 'default'
|
||||
| 'secondary'
|
||||
| 'success'
|
||||
| 'warning'
|
||||
| 'error'
|
||||
type NormalTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'
|
||||
```
|
||||
|
||||
|
||||
</Attributes>
|
||||
|
||||
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