Skip to content

Commit 57df15c

Browse files
committed
cleaned up the config.ts
Signed-off-by: René <snooz@posteo.de>
1 parent 2cbd7fa commit 57df15c

1 file changed

Lines changed: 80 additions & 93 deletions

File tree

website/docusaurus.config.ts

Lines changed: 80 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
// @ts-check
2-
// Note: type annotations allow type checking and IDEs autocompletion
3-
4-
const lightCodeTheme = require('prism-react-renderer').themes.vsLight;
5-
const darkCodeTheme = require('prism-react-renderer').themes.dracula;
1+
import { themes as prismThemes } from 'prism-react-renderer';
62
import remarkDirective from "remark-directive";
73
import remarkTermDirective from "./src/remark/remark-term-directive.js";
84
import codeMaxLineLength from './src/remark/remark-code-max-line-length.js';
5+
import type { Config } from '@docusaurus/types';
6+
import type * as Preset from '@docusaurus/preset-classic';
97

108
const rawDocsBuildMode = process.env.DOCS_BUILD_MODE ?? 'preview';
119

@@ -17,9 +15,7 @@ if (!['preview', 'production'].includes(rawDocsBuildMode)) {
1715

1816
const includeCurrentVersion = rawDocsBuildMode === 'preview';
1917

20-
21-
/** @type {import('@docusaurus/types').Config} */
22-
const config = {
18+
const config: Config = {
2319
title: 'Syllabus of Robot Framework® Certified Professional',
2420
tagline: 'The foundation for the "Robot Framework® Certified Professional" (RFCP®) exam and training',
2521
url: 'https://robotframework.org',
@@ -35,112 +31,103 @@ const config = {
3531
future: {
3632
v4: true, // Improve compatibility with the upcoming Docusaurus v4
3733
},
38-
organizationName: 'robotframework', // Usually your GitHub org/user name.
39-
projectName: 'robotframework-RFCP-syllabus', // Usually your repo name.
34+
organizationName: 'robotframework',
35+
projectName: 'robotframework-RFCP-syllabus',
4036
trailingSlash: false,
4137
presets: [
4238
[
4339
'classic',
44-
/** @type {import('@docusaurus/preset-classic').Options} */
4540
({
4641
docs: {
4742
includeCurrentVersion,
4843
admonitions: {
4944
keywords: ['lo', 'K1', 'K2', 'K3', 'note', 'tip', 'info', 'warning', 'danger'],
5045
extendDefaults: true,
5146
},
52-
routeBasePath: '/docs',
53-
sidebarPath: require.resolve('./sidebars.js'),
54-
// Please change this to your repo.
55-
// editUrl: 'https://github.com/robotframework/robotframework-RFCP-syllabus/edit/docusaurus/website',
47+
sidebarPath: './sidebars.ts',
5648
remarkPlugins: [remarkDirective, remarkTermDirective, [codeMaxLineLength, { max: 100 }]],
5749
},
5850
blog: false,
5951
theme: {
60-
customCss: require.resolve('./src/css/custom.css'),
52+
customCss: './src/css/custom.css',
6153
},
62-
}),
54+
} satisfies Preset.Options),
6355
],
6456
],
65-
themeConfig:
66-
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
67-
({
68-
colorMode: {
69-
defaultMode: 'dark',
70-
disableSwitch: false,
71-
respectPrefersColorScheme: false,
57+
themeConfig: ({
58+
colorMode: {
59+
defaultMode: 'dark',
60+
disableSwitch: false,
61+
respectPrefersColorScheme: true,
62+
},
63+
navbar: {
64+
title: 'RFCP-Syllabus',
65+
logo: {
66+
alt: 'Robot Framework Logo',
67+
src: 'img/robot-framework.svg',
68+
srcDark: 'img/robot-framework-dark.svg',
7269
},
73-
navbar: {
74-
title: 'RFCP-Syllabus',
75-
logo: {
76-
alt: 'Robot Framework Logo',
77-
src: 'img/robot-framework.svg',
78-
srcDark: 'img/robot-framework-dark.svg',
70+
items: [
71+
{
72+
label: 'Introduction',
73+
to: '/docs/overview',
74+
position: 'left',
7975
},
80-
items: [
81-
{
82-
label: 'Introduction',
83-
to: '/docs/overview',
84-
position: 'left',
85-
},
86-
{
87-
label: 'Chapter 1',
88-
to: '/docs/chapter-01/overview',
89-
position: 'left',
90-
},
91-
{
92-
label: 'Chapter 2',
93-
to: '/docs/chapter-02/overview',
94-
position: 'left',
95-
},
96-
{
97-
label: 'Chapter 3',
98-
to: '/docs/chapter-03/overview',
99-
position: 'left',
100-
},
101-
{
102-
label: 'Chapter 4',
103-
to: '/docs/chapter-04/overview',
104-
position: 'left',
105-
},
106-
{
107-
label: 'Chapter 5',
108-
to: '/docs/chapter-05/overview',
109-
position: 'left',
110-
},
111-
{
112-
label: 'Example Exam',
113-
to: '/docs/example-exam',
114-
position: 'left',
115-
},
116-
{
117-
label: 'LOs',
118-
to: '/docs/learning_objectives',
119-
position: 'left',
120-
},
121-
{
122-
type: 'docsVersionDropdown',
123-
position: 'right',
124-
docsPluginId: 'default',
125-
dropdownActiveClassDisabled: true,
126-
},
127-
],
128-
},
129-
footer: {
130-
style: 'dark',
131-
links: [
132-
],
133-
copyright: `Copyright © ${new Date().getFullYear()} Robot Framework® Foundation - Syllabus of Robot Framework® Certified Professional`,
134-
},
135-
prism: {
136-
theme: lightCodeTheme,
137-
darkTheme: darkCodeTheme,
138-
additionalLanguages: ['robotframework', 'python'],
139-
},
140-
}),
76+
{
77+
label: 'Chapter 1',
78+
to: '/docs/chapter-01/overview',
79+
position: 'left',
80+
},
81+
{
82+
label: 'Chapter 2',
83+
to: '/docs/chapter-02/overview',
84+
position: 'left',
85+
},
86+
{
87+
label: 'Chapter 3',
88+
to: '/docs/chapter-03/overview',
89+
position: 'left',
90+
},
91+
{
92+
label: 'Chapter 4',
93+
to: '/docs/chapter-04/overview',
94+
position: 'left',
95+
},
96+
{
97+
label: 'Chapter 5',
98+
to: '/docs/chapter-05/overview',
99+
position: 'left',
100+
},
101+
{
102+
label: 'Example Exam',
103+
to: '/docs/example-exam',
104+
position: 'left',
105+
},
106+
{
107+
label: 'LOs',
108+
to: '/docs/learning_objectives',
109+
position: 'left',
110+
},
111+
{
112+
type: 'docsVersionDropdown',
113+
position: 'right',
114+
dropdownActiveClassDisabled: true,
115+
},
116+
],
117+
},
118+
footer: {
119+
style: 'dark',
120+
copyright: `Copyright © ${new Date().getFullYear()} Robot Framework® Foundation - Syllabus of Robot Framework® Certified Professional`,
121+
},
122+
prism: {
123+
theme: prismThemes.vsLight,
124+
darkTheme: prismThemes.dracula,
125+
additionalLanguages: ['robotframework', 'python'],
126+
},
127+
} satisfies Preset.ThemeConfig),
141128
plugins: [
142-
require.resolve('docusaurus-lunr-search')
129+
'docusaurus-lunr-search',
143130
],
144131
};
145132

146-
module.exports = config;
133+
export default config;

0 commit comments

Comments
 (0)