-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
165 lines (155 loc) · 4.35 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
165 lines (155 loc) · 4.35 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
const path = require('path')
// parse the current locale from CLI
const idx = process.argv.findIndex(arg => arg === '--locale');
// fallback to EN by default
const currentLocale = (idx !== -1) ? process.argv[idx + 1] : 'en';
const isLocaleCS = currentLocale === 'cs';
const isLocaleEN = currentLocale === 'en';
const URL_CS = 'https://gamejam.aphgames.cz';
// not supported yet!
const URL_EN = 'https://gamejam.aphgames.io';
let url = isLocaleCS ? URL_CS : URL_EN;
const i18n = require(path.resolve(__dirname, `i18n/${currentLocale}/code.json`));
const customFields = {
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://aphgames.cz">APHGAMES.CZ</a>`,
description: 'Velikonoční GameJam na Fakultě informačních technologií ČVUT',
url,
currentLocale,
}
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const output = {
title: i18n['config.title'].message,
url: url,
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.png',
organizationName: 'APHGames',
projectName: 'gamejam-web',
i18n: {
defaultLocale: currentLocale,
locales: [currentLocale], /* the other locale is in another domain */
},
customFields,
plugins: [
[path.resolve(__dirname, 'plugins/docusaurus-search-local'), {
// whether to index docs pages
indexDocs: true,
// Whether to also index the titles of the parent categories in the sidebar of a doc page.
// 0 = disable, 1 = direct parent, 2 = nested parents
indexDocSidebarParentCategories: 3,
indexBlog: true,
indexPages: true,
// ru is a hack for replacing cs, as cs is not supported by the plugin by default
language: ["en", "ru"],
// setting this to "none" will prevent the default CSS to be included. The default CSS
style: undefined,
// lunr.js-specific settings
lunr: {
tokenizerSeparator: /[\s\-]+/,
// how important is the length of the document
b: 0.75,
// boost to common words (doesn't work properly for CZ)
k1: 1.2,
titleBoost: 5,
contentBoost: 1,
parentCategoriesBoost: 2, // Only used when indexDocSidebarParentCategories > 0
}}],
require.resolve('docusaurus-plugin-sass'),
],
themeConfig: {
metadata: [
{
name: 'keywords',
content: i18n['config.keywords'].message
},
{
name: 'keywords',
content: i18n['config.keywords'].message
}
],
colorMode: {
defaultMode: 'dark',
/* I really don't have time to maintain two versions */
disableSwitch: true,
},
image: 'img/oglogo4.jpg',
prism: {
defaultLanguage: 'javascript',
theme: require('./src/internals/prism-dark'),
darkTheme: require('./src/internals/prism-dark'),
},
navbar: {
title: ' ',
logo: {
alt: 'Grafit Logo',
src: '/img/navbar/logo.png'
},
items: [
{
label: i18n['config.rules'].message,
position: 'left',
to: '/rules',
},
{
label: 'FAQ',
position: 'left',
to: '/faq',
},
{
label: i18n['config.gallery'].message,
position: 'left',
to: '/gallery',
},
{
label: ' ',
className: 'header-discord-link',
position: 'right',
href: 'https://discord.com/invite/qDZJ8QM4mz', }
/*{
label: isLocaleCS ? '🇬🇧' : '🇨🇿',
"aria-label": i18n['config.lang'].message,
className: 'header-lang-link',
position: 'right',
href: isLocaleCS ? URL_EN : URL_CS,
},*/
]
},
footer: {
copyright: customFields.copyright
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarItemsGenerator:
async function({
defaultSidebarItemsGenerator,
...args
}) {
// exclude all items that have "exclude_<lang>" in their header based on the locale
// this allow us to completely remove some pages for respective languages
args.docs = args.docs.filter(m => (!isLocaleCS || !m.frontMatter.exclude_cs) && (!isLocaleEN || !m.frontMatter.exclude_en));
const sidebarItems = await defaultSidebarItemsGenerator(args);
return sidebarItems;
},
},
blog: {
showReadingTime: true,
feedOptions: {
type: 'all',
copyright: customFields.copyright
},
showReadingTime: true
},
theme: {
customCss: require.resolve('./src/internals/docusaurus.scss')
},
},
],
],
};
module.exports = output;