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', () => {
const avatar = shallow(
<Avatar src="/images/avatar.png" stacked />,
)
const avatar = shallow(<Avatar src="/images/avatar.png" stacked />)
expect(() => avatar.unmount()).not.toThrow()
})

View File

@@ -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',
},
]
},
}

View File

@@ -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",

View File

@@ -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>

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.Title alias="Input.Textarea">Textarea.Props</Attributes.Title>

View File

@@ -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>

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