Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
📝 update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 13, 2019
1 parent 71e6bb8 commit 6606f6a
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 2 deletions.
119 changes: 118 additions & 1 deletion @antv/gatsby-theme-antv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ module.exports = {
options: {
// pagesPath: './site/pages',
GATrackingId: `UA-XXXXXXXXX-X`,
primaryColor: '#722ED1',
pathPrefix: '/g2',
// https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
theme: {
'primary-color': '#722ED1',
},
},
},
],
Expand All @@ -59,6 +62,12 @@ module.exports = {
playgroundDidMount: 'console.log("playgroundDidMount");',
playgroundWillUnmount: 'console.log("playgroundWillUnmount");',
},
redirects: [
{
from: /\/old-url/,
to: '/new-url', // 不指定 to 时直接跳转到 https://antv-2018.alipay.com/***
},
],
},
};
```
Expand All @@ -72,15 +81,83 @@ module.exports = {
- [Header Props](https://github.com/antvis/gatsby-theme-antv/blob/master/%40antv/gatsby-theme-antv/site/components/Header.tsx#L13-L39)
- [Footer Props](https://github.com/antvis/gatsby-theme-antv/blob/046a9c4e32eea50b49347b114714425a9f99b4b7/%40antv/gatsby-theme-antv/site/components/Footer.tsx#L149-L159)
- [SEO Props](https://github.com/antvis/gatsby-theme-antv/blob/046a9c4e32eea50b49347b114714425a9f99b4b7/%40antv/gatsby-theme-antv/site/components/Seo.tsx#L12-L17)
- [Banner Props](https://github.com/antvis/gatsby-theme-antv/blob/c6178d1baeebce4ef4e31773a6b533020b662b27/%40antv/gatsby-theme-antv/site/components/Banner.tsx#L8-L31)
- [Features Props](https://github.com/antvis/gatsby-theme-antv/blob/c6178d1baeebce4ef4e31773a6b533020b662b27/%40antv/gatsby-theme-antv/site/components/Features.tsx#L7-L17)
- [Cases Props](https://github.com/antvis/gatsby-theme-antv/blob/c6178d1baeebce4ef4e31773a6b533020b662b27/%40antv/gatsby-theme-antv/site/components/Cases.tsx#L14-L25)
- [Companies Props](https://github.com/antvis/gatsby-theme-antv/blob/c6178d1baeebce4ef4e31773a6b533020b662b27/%40antv/gatsby-theme-antv/site/components/Companies.tsx#L6-L16)

```jsx
import SEO from '@antv/gatsby-theme-antv/site/components/Seo';
import Header from '@antv/gatsby-theme-antv/site/components/Header';
import Footer from '@antv/gatsby-theme-antv/site/components/Footer';
import Banner from '@antv/gatsby-theme-antv/site/components/Banner';
import Features from '@antv/gatsby-theme-antv/site/components/Features';
import Applications from '@antv/gatsby-theme-antv/site/components/Applications';
import Companies from '@antv/gatsby-theme-antv/site/components/Companies';

// @antv/gatsby-theme-antv/components/Header for commonjs version

const Layout = () => {
const features = [
{
icon:
'https://gw.alipayobjects.com/zos/basement_prod/5dbaf094-c064-4a0d-9968-76020b9f1510.svg',
title: 'xxxxx',
description: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
},
{
icon:
'https://gw.alipayobjects.com/zos/basement_prod/0a0371ab-6bed-41ad-a99b-87a5044ba11b.svg',
title: 'xxxxx',
description: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
},
{
icon:
'https://gw.alipayobjects.com/zos/basement_prod/716d0bc0-e311-4b28-b79f-afdd16e8148e.svg',
title: 'xxxxx',
description: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
},
];
const cases = [
{
logo:
'https://gw.alipayobjects.com/mdn/rms_23b644/afts/img/A*2Ij9T76DyCcAAAAAAAAAAABkARQnAQ',
title: '灯塔专业版',
description:
'深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金深入金融的基金',
link: '#',
image:
'https://gw.alipayobjects.com/mdn/rms_23b644/afts/img/A*oCd7Sq3N-QEAAAAAAAAAAABkARQnAQ',
},
// ...
];
const companies = [
{
name: '公司1',
image:
'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Z1NnQ6L4xCIAAAAAAAAAAABkARQnAQ',
},
{
name: '公司2',
image:
'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*6u3hTpsd7h8AAAAAAAAAAABkARQnAQ',
},
// ...
];
const notifications = [
{
type: '测试',
title: 'G6 3.2 全新上线!',
date: '2019.12.04',
link: '#',
},
];

const downloadButton = {
text: '下载使用',
link: 'https://antv.alipay.com/zh-cn/index.html',
};

return (
<>
<SEO title="蚂蚁数据可视化" lang="zh" />
Expand All @@ -104,6 +181,33 @@ const Layout = () => {
// columns={[]}
// bottom={<div>powered by antv</div>}
/>

<Banner
coverImage={<svg></svg>} // 右侧 banner svg 内容
title="主页标题"
description="主页描述内容描述内容描述内容描述内容"
buttonText="按钮文字"
buttonHref={'#按钮链接路径'}
notifications={notifications} // 可传 1-2 个内容,若不传则显示 2 个默认通知
style={{}}
className="Banner 的 className"
video="视频按钮点开后视频的链接,不传则不会出现视频按钮"
githubStarLink="Github Star 链接,不传则不会出现 GitHub Start 按钮"
downloadButton={downloadButton} // 不传则不会出现下载按钮
/>
<Features
title="优势页面名称" // 可不传
features={features} // 必传
style={{}}
className="Features 的 className"
/>
<Cases cases={cases} style={{}} className="Cases 的 className" />
<Companies
title="公司页面名称" // 必传
companies={companies} // 必传
style={{}}
className="Companies 的 className"
/>
</>
);
};
Expand Down Expand Up @@ -133,6 +237,19 @@ npm run deploy

> Set envoironment variable `GATSBY_PATH_PREFIX` to `/` in deploy service like netlify to preview pathPrefix site in root domain.
## Install dependency

```bash
cd @antv/gatsby-theme-antv
yarn add shallowequal
```

or

```bash
yarn workspace @antv/gatsby-theme-antv shallowequal
```

## Used libraries

- [Gatsby](https://www.gatsbyjs.org/docs/)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = {
redirects: [
{
from: /\/old-url/,
to: '/new-url',
to: '/new-url', // 不指定 to 时直接跳转到 https://antv-2018.alipay.com/***
},
],
},
Expand Down

0 comments on commit 6606f6a

Please sign in to comment.