From 6606f6a42a4d1960a51829a295f7a4e26a90591a Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 13 Nov 2019 14:59:06 +0800 Subject: [PATCH] :memo: update README.md --- @antv/gatsby-theme-antv/README.md | 119 +++++++++++++++++++++++++++++- README.md | 2 +- 2 files changed, 119 insertions(+), 2 deletions(-) diff --git a/@antv/gatsby-theme-antv/README.md b/@antv/gatsby-theme-antv/README.md index 0daadf6a..68ba4c02 100644 --- a/@antv/gatsby-theme-antv/README.md +++ b/@antv/gatsby-theme-antv/README.md @@ -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', + }, }, }, ], @@ -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/*** + }, + ], }, }; ``` @@ -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 ( <> @@ -104,6 +181,33 @@ const Layout = () => { // columns={[]} // bottom={
powered by antv
} /> + + } // 右侧 banner svg 内容 + title="主页标题" + description="主页描述内容描述内容描述内容描述内容" + buttonText="按钮文字" + buttonHref={'#按钮链接路径'} + notifications={notifications} // 可传 1-2 个内容,若不传则显示 2 个默认通知 + style={{}} + className="Banner 的 className" + video="视频按钮点开后视频的链接,不传则不会出现视频按钮" + githubStarLink="Github Star 链接,不传则不会出现 GitHub Start 按钮" + downloadButton={downloadButton} // 不传则不会出现下载按钮 + /> + + + ); }; @@ -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/) diff --git a/README.md b/README.md index 40a0149d..68ba4c02 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ module.exports = { redirects: [ { from: /\/old-url/, - to: '/new-url', + to: '/new-url', // 不指定 to 时直接跳转到 https://antv-2018.alipay.com/*** }, ], },