forked from docwire/docwire.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
145 lines (132 loc) · 3.97 KB
/
docusaurus.config.js
File metadata and controls
145 lines (132 loc) · 3.97 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
// @ts-check
const {themes} = require('prism-react-renderer');
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
// Automatically detect the repository name for GitHub Pages deployment (e.g. in forks)
const githubRepository = (process.env.GITHUB_REPOSITORY || '').trim();
const parts = githubRepository ? githubRepository.split('/') : [];
const [organizationName, projectName] = parts.length === 2
? parts
: ['docwire', 'docwire.io']; // Default to main repo
const currentBranch = process.env.CURRENT_BRANCH || 'master';
// Production settings for the main repository
const isProd = githubRepository === 'docwire/docwire.io';
const prodUrl = 'https://docwire.io';
const prodBaseUrl = '/';
// Fallback settings for forks and local development
const devUrl = `https://${organizationName}.github.io`;
const devBaseUrl = `/${projectName}/`;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Docwire',
tagline: 'Award-winning modern data processing in C++20',
favicon: 'img/FaviconLogo.png',
// Set the URL and base URL depending on the environment
url: isProd ? prodUrl : devUrl,
baseUrl: isProd ? prodBaseUrl : devBaseUrl,
// GitHub pages deployment config.
organizationName, // Your GitHub username
projectName, // Your repo name
onBrokenLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: false,
blog: {
showReadingTime: true,
editUrl:
`https://github.com/${organizationName}/${projectName}/tree/${currentBranch}/`,
beforeDefaultRemarkPlugins: [
require('./src/plugins/remark-youtube'),
require('./src/plugins/remark-static-images'),
],
},
theme: {
customCss: './src/css/custom.css',
},
pages: {
beforeDefaultRemarkPlugins: [
require('./src/plugins/remark-youtube'),
require('./src/plugins/remark-static-images'),
],
},
gtag: {
trackingID: isProd ? 'G-KEVHQDD6GK' : 'G-0000000000',
anonymizeIP: true,
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/docusaurus-social-card.jpg',
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: '',
logo: {
alt: 'Docwire Logo',
src: 'img/logoDocWire.JPG',
},
items: [
{to: '/about-us', label: 'About Us', position: 'left'},
{to: '/showcases', label: 'Showcases', position: 'left'},
{
href: 'https://docwire.readthedocs.io/',
position: 'left',
label: 'Documentation',
},
{
href: 'https://github.com/docwire/docwire/releases',
label: 'Download',
position: 'left',
},
{to: '/blog', label: 'Blog', position: 'left'},
{to: '/contact-us', label: 'Contact Us', position: 'right', className: 'button-pill nav-cta'},
{
href: 'https://github.com/docwire/docwire',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
links: [
{
title: 'Legal',
items: [
{
label: 'Privacy Policy',
to: '/privacy',
},
{
label: 'Terms of Use',
to: '/terms-of-service',
},
],
},
],
copyright: `© DocWire SDK<br/>© SILVERCODERS Ltd.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;