-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocusaurus.config.base.js
More file actions
107 lines (97 loc) · 2.96 KB
/
docusaurus.config.base.js
File metadata and controls
107 lines (97 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const { grafanaPrismTheme } = require('./src/theme/prism.ts');
// /** @type {import('@docusaurus/types').Config} */
const baseConfig = {
title: 'Grafana Labs Design System',
tagline: 'Design Systems are cool',
url: 'https://grafana.com/',
baseUrl: 'developers/saga/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/logo.png',
staticDirectories: ['static'],
trailingSlash: true,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'Grafana', // Usually your GitHub org/user name.
projectName: 'design-system', // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/grafana/design-system/blob/main/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
blog: false, // disabled for now but maybe we can have a design system blog later :)
pages: {
path: 'pages',
},
}),
],
],
plugins: [
customPostCssPlugin, // PostCSS plugin function registration
],
themes: ['@docusaurus/theme-live-codeblock'],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// announcementBar: {
// id: 'welcome',
// content:
// 'Welcome to our design system! Learn more <a target="_blank" rel="noopener noreferrer" href="#">here</a>',
// backgroundColor: '#fafbfc',
// textColor: '#091E42',
// isCloseable: true,
// },
colorMode: {
defaultMode: 'dark',
disableSwitch: true,
},
prism: {
theme: grafanaPrismTheme,
},
navbar: {
logo: {
alt: 'Design System logo',
href: 'about/overview',
src: '/img/logo_with_text.png',
},
items: [
{
href: 'https://github.com/grafana/design-system',
label: 'GitHub',
position: 'right',
},
],
},
}),
scripts: ['https://klesun-misc.github.io/TypeScript/lib/typescriptServices.js'],
};
/** @return {import('@docusaurus/types').Plugin} */
function customPostCssPlugin() {
return {
name: 'custom-postcss',
configurePostCss(options) {
// Append new PostCSS plugins here.
options.plugins.push(require('postcss-preset-env')); // allow newest CSS syntax
return options;
},
};
}
module.exports = baseConfig;