@antv/gatsby-theme-antv
Ant Visualization solution home page
Last updated 17 days ago by winniexing .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @antv/gatsby-theme-antv 
SYNC missed versions from official npm registry.
图片

Gatsby Theme for AntV ⚛

✨ Polished Gatsby theme for documentation site.

NPM downloads CI status Dependency Status devDependencies Status prettier code style

Features

  • ⚛ Prerendered static site
  • ???? Internationalization support by i18next
  • ???? Markdown-based documentation and menus
  • ???? Examples with live playground
  • ???? Unified Theme and Layout
  • ???? Easy customized header nav
  • ???? Built-in home page components

Websites using it

Usage

Create a Gatsby site from gatsby-starter-theme-antv.

$ yarn global add gatsby-cli // or npm install gatsby-cli -g
$ gatsby new mysite https://github.com/antvis/gatsby-starter-theme-antv

Start developing.

$ cd mysite
$ yarn start

✨ AntV 站点 接入方式额外功能

gatsby-config.js

// gatsby-config.js
const { repository } = require('./package.json');

module.exports = {
  plugins: [
    {
      resolve: `@antv/gatsby-theme-antv`,
      options: {
        // pagesPath: './site/pages',
        GATrackingId: `UA-XXXXXXXXX-X`,
        pathPrefix: '/g2',
        // antd 主题:https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
        theme: {
          'primary-color': '#873bf4',
        },
        pwa: true, // 是否开启 gatsby-plugin-offline
        cname: true, // 是否自动从 siteUrl 中提取 CNAME 文件
        codeSplit: true, // 是否开启 gatsby 按路由的代码分割,默认为 false
      },
    },
  ],
  siteMetadata: {
    title: `AntV`,
    description: `Ant Visualization solution home page`,
    githubUrl: repository.url,
    logoUrl: '', // 自定义 logo
    navs: [], // 用于定义顶部菜单
    docs: [], // 用于定义文档页面的二级分类菜单
    examples: [], // 用于定义演示页面的二级菜单,属性见下方
    showSearch: true, // 是否展示搜索框
    showChinaMirror: true, // 是否展示国内镜像链接
    showLanguageSwitcher: true, // 用于定义是否展示语言切换
    showAntVProductsCard: true, // 是否展示 AntV 系列产品的卡片链接
    showGithubCorner: true, // 是否展示角落的 GitHub 图标
    showChartResize: true, // 是否在demo页展示图表视图切换
    themeSwitcher: 'g2', // 是否在demo页展示主题切换, 取值为'g2' | 'g2plot' 如果不设置则不展示主题切换工具
    showAPIDoc: true, // 是否在demo页展示API文档
    playground: {
      container: '<canvas id="container" />', // 定义演示的渲染节点,默认 <div id="container" />
      playgroundDidMount: 'console.log("playgroundDidMount");',
      playgroundWillUnmount: 'console.log("playgroundWillUnmount");',
    },
    versions: [
      {
        '1.x': 'https://1x.ant.design',
        '2.x': 'https://2x.ant.design',
        '3.x': 'https://ant.design',
        '4.x': 'https://next.ant.design',
      },
    ],
    redirects: [
      {
        from: /\/old-url/,
        to: '/new-url', // 不指定 to 时直接跳转到 https://antv-2018.alipay.com/***
      },
    ],
  },
};

Components

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" />
      <Header
        subTitle="子产品名"
        logo={{
          link: 'https://antv.alipay.com',
          img: <img src="url" />,
        }}
        githubUrl="https://github.com/antvis/g2"
        // docs={[]}
        showSearch={false}
        showGithubCorner={false}
        showLanguageSwitcher={false}
        onLanguageChange={(language) => {
          console.log(language);
        }}
        defaultLanguage="zh"
      />
      <Footer
      // 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"
      />
    </>
  );
};

Develop

yarn install
yarn start

Visit https://localhost:8000 to preview.

Publish to npm

cd @antv/gatsby-theme-antv
npm run release

Deploy

npm run deploy

Set envoironment variable GATSBY_PATH_PREFIX to / in deploy service like netlify to preview pathPrefix site in root domain.

Add Dependency

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

or

yarn workspace @antv/gatsby-theme-antv shallowequal

Related libraries

Current Tags

  • 1.1.0-alpha.2                                ...           alpha (2 months ago)
  • 1.0.0-beta.19                                ...           beta (2 months ago)
  • 1.0.7                                ...           latest (17 days ago)

243 Versions

  • 1.0.7                                ...           17 days ago
  • 1.0.6                                ...           17 days ago
  • 1.0.5                                ...           a month ago
  • 1.0.4                                ...           a month ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 1.0.0-beta.19                                ...           2 months ago
  • 1.0.0-beta.18                                ...           2 months ago
  • 1.1.0-alpha.2                                ...           2 months ago
  • 1.0.0-beta.17                                ...           2 months ago
  • 1.0.0-beta.16                                ...           2 months ago
  • 1.1.0-alpha.1                                ...           2 months ago
  • 1.1.0-alpha.0                                ...           2 months ago
  • 1.0.0-beta.15                                ...           2 months ago
  • 1.0.0-beta.14                                ...           2 months ago
  • 1.0.0-beta.13                                ...           2 months ago
  • 1.0.0-beta.12                                ...           2 months ago
  • 1.0.0-beta.11                                ...           3 months ago
  • 1.1.0-beta.0                                ...           3 months ago
  • 1.0.0-beta.10                                ...           3 months ago
  • 1.0.0-beta.9                                ...           3 months ago
  • 1.0.0-beta.8                                ...           4 months ago
  • 0.11.7                                ...           4 months ago
  • 1.0.0-beta.5                                ...           4 months ago
  • 1.0.0-beta.4                                ...           4 months ago
  • 1.0.0-beta.3                                ...           4 months ago
  • 1.0.0-beta.1                                ...           5 months ago
  • 0.10.72                                ...           5 months ago
  • 0.11.6                                ...           5 months ago
  • 0.11.5                                ...           5 months ago
  • 0.11.4                                ...           5 months ago
  • 1.0.0-beta.0                                ...           5 months ago
  • 0.11.3                                ...           5 months ago
  • 0.11.2                                ...           6 months ago
  • 0.11.1                                ...           6 months ago
  • 0.11.0                                ...           6 months ago
  • 0.10.71                                ...           6 months ago
  • 0.10.70                                ...           6 months ago
  • 0.10.69                                ...           7 months ago
  • 0.10.68                                ...           7 months ago
  • 0.10.67                                ...           7 months ago
  • 0.10.66                                ...           7 months ago
  • 0.10.65                                ...           7 months ago
  • 0.10.64                                ...           8 months ago
  • 0.10.63                                ...           8 months ago
  • 0.10.62                                ...           9 months ago
  • 0.10.61                                ...           9 months ago
  • 0.10.60                                ...           9 months ago
  • 0.10.59                                ...           9 months ago
  • 0.10.58                                ...           9 months ago
  • 0.10.57                                ...           10 months ago
  • 0.10.56                                ...           10 months ago
  • 0.10.55                                ...           10 months ago
  • 0.10.54                                ...           10 months ago
  • 0.10.53                                ...           10 months ago
  • 0.10.52                                ...           10 months ago
  • 0.10.51                                ...           10 months ago
  • 0.10.50                                ...           10 months ago
  • 0.10.49                                ...           10 months ago
  • 0.10.48                                ...           10 months ago
  • 0.10.47                                ...           a year ago
  • 0.10.46                                ...           a year ago
  • 0.10.45                                ...           a year ago
  • 0.10.44                                ...           a year ago
  • 0.10.43                                ...           a year ago
  • 0.10.42                                ...           a year ago
  • 0.10.41                                ...           a year ago
  • 0.10.40                                ...           a year ago
  • 0.10.39                                ...           a year ago
  • 0.10.38                                ...           a year ago
  • 0.10.37                                ...           a year ago
  • 0.10.36                                ...           a year ago
  • 0.10.35                                ...           a year ago
  • 0.10.34                                ...           a year ago
  • 0.10.33                                ...           a year ago
  • 0.10.32                                ...           a year ago
  • 0.10.31                                ...           a year ago
  • 0.10.30                                ...           a year ago
  • 0.10.29                                ...           a year ago
  • 0.10.28                                ...           a year ago
  • 0.10.27                                ...           a year ago
  • 0.10.26                                ...           a year ago
  • 0.10.25                                ...           a year ago
  • 0.10.24                                ...           a year ago
  • 0.10.23                                ...           a year ago
  • 0.10.22                                ...           a year ago
  • 0.10.21                                ...           a year ago
  • 0.10.20                                ...           a year ago
  • 0.10.19                                ...           a year ago
  • 0.10.18                                ...           a year ago
  • 0.10.17                                ...           a year ago
  • 0.10.16                                ...           a year ago
  • 0.10.15                                ...           a year ago
  • 0.10.14                                ...           a year ago
  • 0.10.13                                ...           a year ago
  • 0.10.12                                ...           a year ago
  • 0.10.11                                ...           a year ago
  • 0.10.10                                ...           a year ago
  • 0.10.9                                ...           a year ago
  • 0.10.8                                ...           a year ago
  • 0.10.7                                ...           a year ago
  • 0.10.6                                ...           a year ago
  • 0.10.5                                ...           a year ago
  • 0.10.4                                ...           a year ago
  • 0.10.3                                ...           a year ago
  • 0.10.2                                ...           a year ago
  • 0.10.1                                ...           a year ago
  • 0.10.0                                ...           a year ago
  • 0.9.108                                ...           a year ago
  • 0.9.106                                ...           a year ago
  • 0.9.102                                ...           a year ago
  • 0.9.101                                ...           a year ago
  • 0.9.100                                ...           a year ago
  • 0.9.99                                ...           a year ago
  • 0.9.98                                ...           a year ago
  • 0.9.97                                ...           a year ago
  • 0.9.95                                ...           a year ago
  • 0.9.94                                ...           a year ago
  • 0.9.93                                ...           a year ago
  • 0.9.92                                ...           a year ago
  • 0.9.91                                ...           a year ago
  • 0.9.90                                ...           a year ago
  • 0.9.89                                ...           a year ago
  • 0.9.88                                ...           a year ago
  • 0.9.87                                ...           a year ago
  • 0.9.86                                ...           a year ago
  • 0.9.85                                ...           a year ago
  • 0.9.84                                ...           a year ago
  • 0.9.83                                ...           a year ago
  • 0.9.82                                ...           a year ago
  • 0.9.81                                ...           a year ago
  • 0.9.80                                ...           a year ago
  • 0.9.79                                ...           a year ago
  • 0.9.78                                ...           a year ago
  • 0.9.77                                ...           a year ago
  • 0.9.76                                ...           a year ago
  • 0.9.75                                ...           a year ago
  • 0.9.74                                ...           a year ago
  • 0.9.73                                ...           a year ago
  • 0.9.72                                ...           a year ago
  • 0.9.71                                ...           a year ago
  • 0.9.70                                ...           a year ago
  • 0.9.69                                ...           a year ago
  • 0.9.68                                ...           a year ago
  • 0.9.67                                ...           a year ago
  • 0.9.66                                ...           a year ago
  • 0.9.65                                ...           a year ago
  • 0.9.64                                ...           a year ago
  • 0.9.63                                ...           a year ago
  • 0.9.62                                ...           a year ago
  • 0.9.61                                ...           a year ago
  • 0.9.60                                ...           a year ago
  • 0.9.59                                ...           a year ago
  • 0.9.58                                ...           a year ago
  • 0.9.57                                ...           a year ago
  • 0.9.56                                ...           a year ago
  • 0.9.55                                ...           a year ago
  • 0.9.54                                ...           a year ago
  • 0.9.53                                ...           a year ago
  • 0.9.52                                ...           a year ago
  • 0.9.51                                ...           a year ago
  • 0.9.50                                ...           a year ago
  • 0.9.49                                ...           a year ago
  • 0.9.48                                ...           a year ago
  • 0.9.47                                ...           a year ago
  • 0.9.46                                ...           a year ago
  • 0.9.45                                ...           a year ago
  • 0.9.44                                ...           a year ago
  • 0.9.43                                ...           a year ago
  • 0.9.42                                ...           a year ago
  • 0.9.41                                ...           a year ago
  • 0.9.40                                ...           a year ago
  • 0.9.35                                ...           a year ago
  • 0.9.34                                ...           a year ago
  • 0.9.33                                ...           a year ago
  • 0.9.32                                ...           a year ago
  • 0.9.31                                ...           a year ago
  • 0.9.30                                ...           a year ago
  • 0.9.29                                ...           a year ago
  • 0.9.28                                ...           a year ago
  • 0.9.27                                ...           a year ago
  • 0.9.26                                ...           a year ago
  • 0.9.25                                ...           a year ago
  • 0.9.24                                ...           a year ago
  • 0.9.23                                ...           a year ago
  • 0.9.22                                ...           a year ago
  • 0.9.21                                ...           a year ago
  • 0.9.19                                ...           a year ago
  • 0.9.18                                ...           a year ago
  • 0.9.17                                ...           a year ago
  • 0.9.16                                ...           a year ago
  • 0.9.15                                ...           a year ago
  • 0.9.14                                ...           a year ago
  • 0.9.13                                ...           a year ago
  • 0.9.12                                ...           a year ago
  • 0.9.11                                ...           a year ago
  • 0.9.10                                ...           a year ago
  • 0.9.9                                ...           a year ago
  • 0.9.8                                ...           a year ago
  • 0.9.7                                ...           a year ago
  • 0.9.5                                ...           a year ago
  • 0.9.4                                ...           a year ago
  • 0.9.3                                ...           a year ago
  • 0.9.2                                ...           a year ago
  • 0.9.1                                ...           a year ago
  • 0.9.0                                ...           a year ago
  • 0.8.3                                ...           a year ago
  • 0.8.2                                ...           a year ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.7                                ...           a year ago
  • 0.7.6                                ...           a year ago
  • 0.7.5                                ...           a year ago
  • 0.7.4                                ...           a year ago
  • 0.7.3                                ...           a year ago
  • 0.7.2                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.2                                ...           a year ago
  • 0.6.1                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.6                                ...           a year ago
  • 0.5.4                                ...           a year ago
  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Downloads
Today 0
This Week 16
This Month 820
Last Day 16
Last Week 326
Last Month 1,167
Dependencies (98)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |