Skip to content

Commit

Permalink
Fix docs build (chartjs#10566)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored Aug 5, 2022
1 parent e798def commit 29395d9
Show file tree
Hide file tree
Showing 5 changed files with 9,439 additions and 5,858 deletions.
33 changes: 14 additions & 19 deletions docs/.vuepress/config.cjs → docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const path = require('path');
import { DefaultThemeConfig, defineConfig, PluginTuple } from "vuepress/config";
import * as path from 'path';
import markdownItInclude from 'markdown-it-include';

const docsVersion = "VERSION";
const base = process.env.NODE_ENV === "development" ? '/docs/master/' : `/docs/${docsVersion}/`;
const base: `/${string}/` = process.env.NODE_ENV === "development" ? '/docs/master/' : `/docs/${docsVersion}/`;

module.exports = {
export default defineConfig({
title: 'Chart.js',
description: 'Open source HTML5 Charts for your website',
theme: 'chartjs',
Expand Down Expand Up @@ -30,16 +33,10 @@ module.exports = {
],
}],
['vuepress-plugin-code-copy', true],
[
'vuepress-plugin-typedoc',
{
['vuepress-plugin-typedoc', {
entryPoints: ['../../types/index.d.ts'],
hideInPageTOC: true,
tsconfig: 'tsconfig.json',
sidebar: {
fullNames: true,
parentCategory: 'API',
},
},
],
['@simonbrunel/vuepress-plugin-versions', {
Expand All @@ -48,7 +45,7 @@ module.exports = {
title: (v, vars) => {
return window.location.href.includes('master') ? 'Development (master)' :
vars.tag === 'latest' ? 'Latest (' + v + ')' :
v + (vars.tag ? ` (${tag})` : '') + ' (outdated)';
v + (vars.tag ? ` (${vars.tag})` : '') + ' (outdated)';
},
},
menu: {
Expand Down Expand Up @@ -89,7 +86,7 @@ module.exports = {
]
},
}],
],
] as PluginTuple[],
chainWebpack(config) {
config.merge({
resolve: {
Expand All @@ -101,7 +98,7 @@ module.exports = {
},
markdown: {
extendMarkdown: md => {
md.use(require('markdown-it-include'), path.resolve(__dirname, '../'));
md.use(markdownItInclude, path.resolve(__dirname, '../'));
}
},
themeConfig: {
Expand Down Expand Up @@ -134,9 +131,7 @@ module.exports = {
}
],
sidebar: {
'/api/': {
title: 'API'
},
'/api/': 'API',
'/samples/': [
'information',
{
Expand Down Expand Up @@ -389,6 +384,6 @@ module.exports = {
]
},
],
}
}
};
} as any
} as DefaultThemeConfig
});
Loading

0 comments on commit 29395d9

Please sign in to comment.