Skip to content

Commit

Permalink
docs: add customPages example
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Aug 8, 2024
1 parent 96d767a commit c75a9a8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
39 changes: 39 additions & 0 deletions example/.dumi/pages/custom.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Features, FeaturesProps, Snippet } from '@lobehub/ui';
import { Palette, Smartphone, Zap } from 'lucide-react';
import React from 'react';
import { Center } from 'react-layout-kit';

const items: FeaturesProps['items'] = [
{
description:
'Based on antd v5, custom algorithms for light and dark themes are provided by default, offering aesthetically pleasing and user-friendly options.',
icon: Palette,
title: 'Themeable',
},
{
description:
'This theme package adopts modern design techniques, making the documents more intuitive, readable, and user-friendly.',
icon: Zap,
title: 'Modern',
},
{
description:
'Well-adapted for mobile devices. With the flexible style solution based on CSSinJS, multiple layout options are easily implemented.',
icon: Smartphone,
title: 'Mobile-Adapted',
},
];

const Custom = () => {
return (
<Center gap={32}>
<Center>
<h2 style={{ fontSize: 20 }}>To install dumi-theme-yunti, run the following command:</h2>
<Snippet language={'bash'}>{'$ pnpm add dumi dumi-theme-yunti'}</Snippet>
</Center>
<Features items={items} />
</Center>
);
};

export default Custom;
9 changes: 9 additions & 0 deletions example/.dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const themeConfig = defineThemeConfig({
{ title: 'Components', link: '/components/example' },
{ title: '分组示例', link: '/config/base' },
{ title: '折叠示例', link: '/demo/secondary-sidebar-colors' },
{ title: '自定义页面', link: '/custom', target: '_blank' },
{ title: 'Changelog', link: '/changelog' },
{ title: 'Yunti UI', link: 'https://yuntijs.github.io/yunti-ui/' },
],
Expand All @@ -57,6 +58,14 @@ const themeConfig = defineThemeConfig({
{ title: 'Collapse Demo', link: '/demo/secondary-sidebar-colors-en' },
],
},
customPages: [
{
path: '/custom',
sider: false,
header: false,
footer: false,
},
],
});

const base = isProduction && !isPreview ? '/dumi-theme-yunti/' : '/';
Expand Down
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.dumi/theme
.dumi/tmp*

0 comments on commit c75a9a8

Please sign in to comment.