]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Use full URL for TypeDocs (#7380)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Thu, 21 May 2020 21:11:46 +0000 (00:11 +0300)
committerGitHub <noreply@github.com>
Thu, 21 May 2020 21:11:46 +0000 (17:11 -0400)
Use full URL for TypeDocs

docs/docusaurus.config.js
docs/sidebars.js

index 76620e2c1616f064b45b585b44691e2a6e2ce629..f0c50a54fda4a156f80ac8e0907739554d0d390c 100644 (file)
@@ -1,96 +1,96 @@
+/* eslint-disable import/no-commonjs */
 // VERSION replaced by deploy script
 module.exports = {
-  title: 'Chart.js',
-  tagline: 'Open source HTML5 Charts for your website',
-  url: 'https://chartjs.org',
-  baseUrl: '/docs/VERSION/',
-  favicon: 'img/favicon.ico',
-  organizationName: 'chartjs', // Usually your GitHub org/user name.
-  projectName: 'chartjs.github.io', // Usually your repo name.
-  plugins: ['@docusaurus/plugin-google-analytics'],
-  scripts: ['https://www.chartjs.org/dist/VERSION/Chart.min.js'],
-  themes: ['@docusaurus/theme-live-codeblock'],
-  themeConfig: {
-    algolia: {
-      apiKey: 'd7ee00a3cbaaf3c33e28ad1c274e7ba6',
-      indexName: 'chartjs',
-      algoliaOptions: {
-        facetFilters: [`version:VERSION`],
-      }
-    },
-    googleAnalytics: {
-      trackingID: 'UA-28909194-3',
-      // Optional fields.
-      anonymizeIP: true, // Should IPs be anonymized?
-    },
-    disableDarkMode: true, // Would need to implement for Charts embedded in docs
-    navbar: {
-      title: 'Chart.js',
-      logo: {
-        alt: 'Chart.js Logo',
-        src: 'img/logo.svg',
-      },
-    },
-    footer: {
-      style: 'dark',
-      links: [
-        {
-          title: 'Other Docs',
-          items: [
-            {
-              label: 'Samples',
-              href: 'https://www.chartjs.org/samples/VERSION/',
-            },
-            {
-              label: 'v2 Docs',
-              href: 'https://www.chartjs.org/docs/2.9.3/',
-            },
-          ],
-        },
-        {
-          title: 'Community',
-          items: [
-            {
-              label: 'Slack',
-              href: 'https://chartjs-slack.herokuapp.com/',
-            },
-            {
-              label: 'Stack Overflow',
-              href: 'https://stackoverflow.com/questions/tagged/chart.js',
-            },
-          ],
-        },
-        {
-          title: 'Developers',
-          items: [
-            {
-              label: 'GitHub',
-              href: 'https://github.com/chartjs/Chart.js',
-            },
-            {
-              label: 'Contributing',
-              to: 'developers/contributing',
-            },
-          ],
-        },
-      ],
-      copyright: `Copyright © ${new Date().getFullYear()} Chart.js contributors.`,
-    },
-  },
-  presets: [
-    [
-      '@docusaurus/preset-classic',
-      {
-        docs: {
-          sidebarPath: require.resolve('./sidebars.js'),
-          routeBasePath: '',
-          editUrl:
-            'https://github.com/chartjs/Chart.js/edit/master/docs/',
-        },
-        theme: {
-          customCss: require.resolve('./src/css/custom.css'),
-        },
-      },
-    ],
-  ],
+       title: 'Chart.js',
+       tagline: 'Open source HTML5 Charts for your website',
+       url: 'https://chartjs.org',
+       baseUrl: '/docs/VERSION/',
+       favicon: 'img/favicon.ico',
+       organizationName: 'chartjs', // Usually your GitHub org/user name.
+       projectName: 'chartjs.github.io', // Usually your repo name.
+       plugins: ['@docusaurus/plugin-google-analytics'],
+       scripts: ['https://www.chartjs.org/dist/VERSION/Chart.min.js'],
+       themes: ['@docusaurus/theme-live-codeblock'],
+       themeConfig: {
+               algolia: {
+                       apiKey: 'd7ee00a3cbaaf3c33e28ad1c274e7ba6',
+                       indexName: 'chartjs',
+                       algoliaOptions: {
+                               facetFilters: ['version:VERSION'],
+                       }
+               },
+               googleAnalytics: {
+                       trackingID: 'UA-28909194-3',
+                       // Optional fields.
+                       anonymizeIP: true, // Should IPs be anonymized?
+               },
+               disableDarkMode: true, // Would need to implement for Charts embedded in docs
+               navbar: {
+                       title: 'Chart.js',
+                       logo: {
+                               alt: 'Chart.js Logo',
+                               src: 'img/logo.svg',
+                       },
+               },
+               footer: {
+                       style: 'dark',
+                       links: [
+                               {
+                                       title: 'Other Docs',
+                                       items: [
+                                               {
+                                                       label: 'Samples',
+                                                       href: 'https://www.chartjs.org/samples/VERSION/',
+                                               },
+                                               {
+                                                       label: 'v2 Docs',
+                                                       href: 'https://www.chartjs.org/docs/2.9.3/',
+                                               },
+                                       ],
+                               },
+                               {
+                                       title: 'Community',
+                                       items: [
+                                               {
+                                                       label: 'Slack',
+                                                       href: 'https://chartjs-slack.herokuapp.com/',
+                                               },
+                                               {
+                                                       label: 'Stack Overflow',
+                                                       href: 'https://stackoverflow.com/questions/tagged/chart.js',
+                                               },
+                                       ],
+                               },
+                               {
+                                       title: 'Developers',
+                                       items: [
+                                               {
+                                                       label: 'GitHub',
+                                                       href: 'https://github.com/chartjs/Chart.js',
+                                               },
+                                               {
+                                                       label: 'Contributing',
+                                                       to: 'developers/contributing',
+                                               },
+                                       ],
+                               },
+                       ],
+                       copyright: `Copyright © ${new Date().getFullYear()} Chart.js contributors.`,
+               },
+       },
+       presets: [
+               [
+                       '@docusaurus/preset-classic',
+                       {
+                               docs: {
+                                       sidebarPath: require.resolve('./sidebars.js'),
+                                       routeBasePath: '',
+                                       editUrl: 'https://github.com/chartjs/Chart.js/edit/master/docs/',
+                               },
+                               theme: {
+                                       customCss: require.resolve('./src/css/custom.css'),
+                               },
+                       },
+               ],
+       ],
 };
index 7e6e4bae7cab5e5ced5bb37e192cfca266edcb25..d19eb365a98aa4bcba3799a22ea8d72124e1c62d 100644 (file)
@@ -1,82 +1,85 @@
+const pkg = require('../package.json');
+const docsVersion = pkg.version.indexOf('-') > -1 ? 'next' : 'latest';
+
 module.exports = {
-  someSidebar: {
-    Introduction: ['index'],
-    'Getting Started': [
-      'getting-started/index',
-      'getting-started/installation',
-      'getting-started/integration',
-      'getting-started/usage',
-      'getting-started/v3-migration'
-     ],
-    General: [
-      'general/data-structures',
-      'general/accessibility',
-      'general/responsive',
-      'general/device-pixel-ratio',
-      {Interactions: ['general/interactions/index', 'general/interactions/events', 'general/interactions/modes']},
-      'general/options',
-      'general/colors',
-      'general/fonts',
-      'general/performance'
-    ],
-    Configuration: [
-      'configuration/index',
-      'configuration/animations',
-      'configuration/layout',
-      'configuration/legend',
-      'configuration/title',
-      'configuration/tooltip',
-      'configuration/elements'
-    ],
-    'Chart Types': [
-      'charts/line',
-      'charts/bar',
-      'charts/radar',
-      'charts/doughnut',
-      'charts/polar',
-      'charts/bubble',
-      'charts/scatter',
-      'charts/area',
-      'charts/mixed'
-    ],
-    Axes:[
-     'axes/index',
-     Cartesian: [
-       'axes/cartesian/index',
-       'axes/cartesian/category',
-       'axes/cartesian/linear',
-       'axes/cartesian/logarithmic',
-       'axes/cartesian/time'
-     ]},
-     Radial: [
-       'axes/radial/index',
-       'axes/radial/linear'
-     ]},
-     'axes/labelling',
-     'axes/styling'
-   ],
-   Developers: [
-     'developers/index',
-     'developers/api',
-     {
-       type: 'link',
-       label: 'TypeDoc',
-       href: 'typedoc/index.html'
-     },
-     'developers/updates',
-     'developers/plugins',
-     'developers/charts',
-     'developers/axes',
-     'developers/contributing'
-    ],
-    'Additional Notes':[
-      'notes/comparison',
-       {
-         type: 'link',
-         label: 'Extensions',
-         href: 'https://github.com/chartjs/awesome'
-       },
-      'notes/license'
-    ]
-  },
+       someSidebar: {
+               Introduction: ['index'],
+               'Getting Started': [
+                       'getting-started/index',
+                       'getting-started/installation',
+                       'getting-started/integration',
+                       'getting-started/usage',
+                       'getting-started/v3-migration'
+               ],
+               General: [
+                       'general/data-structures',
+                       'general/accessibility',
+                       'general/responsive',
+                       'general/device-pixel-ratio',
+                       {Interactions: ['general/interactions/index', 'general/interactions/events', 'general/interactions/modes']},
+                       'general/options',
+                       'general/colors',
+                       'general/fonts',
+                       'general/performance'
+               ],
+               Configuration: [
+                       'configuration/index',
+                       'configuration/animations',
+                       'configuration/layout',
+                       'configuration/legend',
+                       'configuration/title',
+                       'configuration/tooltip',
+                       'configuration/elements'
+               ],
+               'Chart Types': [
+                       'charts/line',
+                       'charts/bar',
+                       'charts/radar',
+                       'charts/doughnut',
+                       'charts/polar',
+                       'charts/bubble',
+                       'charts/scatter',
+                       'charts/area',
+                       'charts/mixed'
+               ],
+               Axes: [
+                       'axes/index',
+                       {Cartesian: [
+                               'axes/cartesian/index',
+                               'axes/cartesian/category',
+                               'axes/cartesian/linear',
+                               'axes/cartesian/logarithmic',
+                               'axes/cartesian/time'
+                       ]},
+                       {Radial: [
+                               'axes/radial/index',
+                               'axes/radial/linear'
+                       ]},
+                       'axes/labelling',
+                       'axes/styling'
+               ],
+               Developers: [
+                       'developers/index',
+                       'developers/api',
+                       {
+                               type: 'link',
+                               label: 'TypeDoc',
+                               href: 'https://chartjs.org/docs/' + docsVersion + '/typedoc/'
+                       },
+                       'developers/updates',
+                       'developers/plugins',
+                       'developers/charts',
+                       'developers/axes',
+                       'developers/contributing'
+               ],
+               'Additional Notes': [
+                       'notes/comparison',
+                       {
+                               type: 'link',
+                               label: 'Extensions',
+                               href: 'https://github.com/chartjs/awesome'
+                       },
+                       'notes/license'
+               ]
+       },
 };