Skip to content

Commit

Permalink
doc: upgrade navs & menus
Browse files Browse the repository at this point in the history
  • Loading branch information
brickspert committed Nov 8, 2021
1 parent 03b7539 commit 09a34d8
Show file tree
Hide file tree
Showing 170 changed files with 294 additions and 1,168 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'consistent-return': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'consistent-return': 'off',
'import/no-useless-path-segments': 'off',
'no-unused-expressions': 'off',
Expand Down
68 changes: 53 additions & 15 deletions .umirc.js → config/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { menus } from './hooks';

export default {
// ssr: {},
exportStatic: {},
Expand Down Expand Up @@ -30,10 +32,9 @@ export default {
logo: '/logo.svg',
dynamicImport: {},
manifest: {},
links: [{ rel: 'manifest', href: '/asset-manifest.json' }],
hash: true,
resolve: {
includes: ['docs', 'packages/hooks/src', 'packages/use-request', 'packages/use-url-state'],
includes: ['docs', 'packages/hooks/src', 'packages'],
},
links: [
{
Expand All @@ -44,37 +45,74 @@ export default {
],
navs: {
'zh-CN': [
null,
{ title: '指南', path: '/zh-CN/guide' },
// TODO how to set default url
{ title: 'Hooks', path: '/zh-CN/hooks' },
{
title: '生态',
title: '历史版本',
children: [
{
title: 'useTable',
path: 'https://usetable-ahooks.js.org/',
title: 'v2.x',
path: 'https://ahooks.js.org/',
},
{
title: 'v1.x',
path: 'http://hooks.umijs.org/',
},
],
},
{ title: 'v1.x', path: 'http://hooks.umijs.org/' },
{ title: 'GitHub', path: 'https://github.com/alibaba/hooks' },
{ title: '更新日志', path: 'https://github.com/alibaba/hooks/releases' },
{ title: '国内镜像', path: 'https://ahooks.gitee.io/zh-CN' },
{ title: 'GitHub', path: 'https://github.com/alibaba/hooks' },
],
'en-US': [
null,
{ title: 'Guide', path: '/guide' },
{ title: 'Hooks', path: '/hooks' },
{
title: 'Ecosystem',
title: 'Legacy Versions',
children: [
{
title: 'useTable',
path: 'https://usetable-ahooks.js.org/',
title: 'v2.x',
path: 'https://ahooks.js.org/',
},
{
title: 'v1.x',
path: 'http://hooks.umijs.org/',
},
],
},
{ title: 'v1.x', path: 'http://hooks.umijs.org/' },
{ title: 'GitHub', path: 'https://github.com/alibaba/hooks' },
{ title: 'Changelog', path: 'https://github.com/alibaba/hooks/releases' },
{ title: 'Releases', path: 'https://github.com/alibaba/hooks/releases' },
{ title: '国内镜像', path: 'https://ahooks.gitee.io/zh-CN' },
{ title: 'GitHub', path: 'https://github.com/alibaba/hooks' },
],
},
menus: {
'/': [
{
title: 'Home',
path: 'index',
},
],
'/zh-CN': [
{
title: '首页',
path: 'index',
},
],
'/guide': [
{
title: 'Quick Start',
path: '/guide/quick-start',
},
],
'/zh-CN/guide': [
{
title: '快速上手',
path: '/guide/quick-start',
},
],
'/hooks': menus,
'/zh-CN/hooks': menus,
},
headScripts: ['https://s4.cnzz.com/z_stat.php?id=1278992092&web_id=1278992092'],
};
113 changes: 113 additions & 0 deletions config/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
export const menus = [
{
title: 'useRequest',
children: [
'useRequest/doc/index',
'useRequest/doc/basic',
'useRequest/doc/loadingDelay',
'useRequest/doc/polling',
'useRequest/doc/refreshOnWindowFocus',
'useRequest/doc/debounce',
'useRequest/doc/throttle',
'useRequest/doc/retry',
'useRequest/doc/refreshDeps',
'useRequest/doc/cache',
],
},
{
title: 'Scene',
children: [
'useAntdTable',
'useFusionTable',
'useInfiniteScroll',
'usePagination',
'useDynamicList',
'useVirtualList',
'useHistoryTravel',
'useNetwork',
'useSelections',
'useCountDown',
'useCounter',
'useTextSelection',
'useWebSocket',
],
},
{
title: 'LifeCycle',
children: ['useMount', 'useUnmount', 'useUnmountedRef'],
},
{
title: 'State',
children: [
'useSetState',
'useBoolean',
'useToggle',
'use-url-state',
'useCookieState',
'useLocalStorageState',
'useSessionStorageState',
'useDebounce',
'useThrottle',
'useMap',
'useSet',
'usePrevious',
'useRafState',
'useSafeState',
],
},
{
title: 'Effect',
children: [
'useUpdateEffect',
'useUpdateLayoutEffect',
'useAsyncEffect',
'useDebounceEffect',
'useDebounceFn',
'useThrottleFn',
'useThrottleEffect',
'useDeepCompareEffect',
'useInterval',
'useTimeout',
'useLockFn',
'useUpdate',
],
},
{
title: 'Dom',
children: [
'useEventListener',
'useClickAway',
'useDocumentVisibility',
'useDrop',
'useEventTarget',
'useExternal',
'useTitle',
'useFavicon',
'useFullscreen',
'useHover',
'useInViewport',
'useKeyPress',
'useLongPress',
'useMouse',
'useResponsive',
'useScroll',
'useSize',
],
},
{
title: 'Advanced',
children: [
'useControllableValue',
'useCreation',
'useEventEmitter',
'useIsomorphicLayoutEffect',
'useLatest',
'useMemoizedFn',
'useReactive',
],
},
{
title: 'Dev',
children: ['useTrackedEffect', 'useWhyDidYouUpdate'],
},
];
105 changes: 0 additions & 105 deletions docs/docs/api.en-US.md

This file was deleted.

Loading

0 comments on commit 09a34d8

Please sign in to comment.