forked from o2switchfr/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
145 lines (142 loc) · 4.23 KB
/
docusaurus.config.ts
File metadata and controls
145 lines (142 loc) · 4.23 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import {
themes as prismThemes,
} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type {Options as DocsOptions} from '@docusaurus/plugin-content-docs';
import type {Options as PageOptions} from '@docusaurus/plugin-content-pages';
import { FontaineTransform } from 'fontaine'
const config: Config = {
title: 'Documentation o2switch',
tagline: "Documentation de l'hébergeur web o2switch",
favicon: '/img/misc/favicon-alt.ico',
url: 'https://faq.o2switch.fr',
baseUrl: '/',
trailingSlash: true,
organizationName: 'o2switchfr',
projectName: 'documentation',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
onBrokenAnchors: 'warn',
onDuplicateRoutes: 'throw',
i18n: {
defaultLocale: 'fr',
locales: ['fr'],
},
future: {
experimental_faster: true,
v4: true,
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
showLastUpdateTime: true,
editUrl:
'https://github.com/o2switchfr/documentation/edit/main/',
routeBasePath: '/',
} satisfies DocsOptions,
blog: false,
pages: {
showLastUpdateAuthor: false,
showLastUpdateTime: false,
} satisfies PageOptions,
theme: {
customCss: [
'./src/css/o2switch.scss',
'./src/css/sprite.css',
],
},
} satisfies Preset.Options,
],
],
themes: ['docusaurus-theme-search-typesense'],
themeConfig: {
typesense: {
typesenseCollectionName: 'faq',
typesenseServerConfig: {
nodes: [
{
host: 'search.o2swit.ch',
port: 443,
protocol: 'https',
},
],
apiKey: '4zufPSau0nNmhvcqnGOzR11UEbf18KYz',
},
// Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
typesenseSearchParameters: {},
contextualSearch: true,
},
/* Not working as of now...
titleFormatter: ({ title, siteConfig }) => {
return `${title}`;
},
*/
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Documentation',
style: 'dark',
logo: {
alt: 'o2switch',
src: 'img/misc/o2switch-logo-dark-bg.svg',
},
items: [
{
type: 'html',
value: '<a href="https://github.com/o2switchfr/documentation" target="_blank" rel="noopener noreferrer nofollow" class="navbar__item navbar__link">GitHub</a>',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [],
copyright: `<a class="footer__link-item" href="https://www.o2switch.fr" target="_blank">© ${new Date().getFullYear()} o2switch.fr - Tous droits réservés</a>`,
},
prism: {
theme: prismThemes.github, // nightOwlLight oneLight vsLight
darkTheme: prismThemes.palenight, // palenight nightOwl
additionalLanguages: ['php', 'apacheconf', 'javascript', 'markup', 'css', 'ruby', 'http', 'git', 'bash', 'json', 'csv'],
},
} satisfies Preset.ThemeConfig,
plugins: [
'docusaurus-plugin-sass',
// @link https://blog.logrocket.com/docusaurus-using-fontaine-reduce-cumulative-layout-shift/
function fontainePlugin(_context, _options) {
return {
name: 'fontaine-plugin',
configureWebpack(_config, _isServer) {
return {
plugins: [
FontaineTransform.webpack({
fallbacks: [
'system-ui',
'-apple-system',
'BlinkMacSystemFont',
'Segoe UI',
'Roboto',
'Oxygen',
'Ubuntu',
'Cantarell',
'Open Sans',
'Helvetica Neue',
'sans-serif',
],
resolvePath: (id) => '../fonts/' + id,
}),
],
};
},
};
},
],
};
export default config;