forked from feature-sliced/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
57 lines (53 loc) · 1.72 KB
/
docusaurus.config.js
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
require("dotenv").config();
const cfg = require("./config/docusaurus");
/** @typedef {import('@docusaurus/types').DocusaurusConfig} Config */
/**
* Custom fields (for access on code-level)
* @see https://docusaurus.io/docs/api/docusaurus-config#customfields
*/
const customFields = {
legacyRoutes: cfg.LEGACY_ROUTES,
// FIXME: Open Graph Experimental Mode.
isOGExperimental: process.env.OG_EXP,
};
/** @type {Config} */
module.exports = {
// General
title: "Feature-Sliced Design",
tagline: "Architectural methodology for frontend projects",
organizationName: "feature-sliced", // Usually your GitHub org/user name.
projectName: "documentation", // Usually your repo name.
url: cfg.consts.DOMAIN,
favicon: "img/favicon/classic.png",
baseUrl: "/",
// Extensions
i18n: cfg.i18n,
presets: cfg.presets,
plugins: cfg.plugins,
// Build & Dev
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onDuplicateRoutes: "warn",
customFields,
trailingSlash: false,
// Theme
themeConfig: {
image: "img/preview.png",
// @see https://docusaurus.io/docs/sidebar#hideable-sidebar
docs: { sidebar: { hideable: true, autoCollapseCategories: true } },
colorMode: { respectPrefersColorScheme: true },
announcementBar: cfg.announcementBar,
navbar: cfg.navbar,
footer: cfg.footer,
algolia: cfg.algolia,
metadata: cfg.metadata,
hotjar: cfg.metrics.hotjar,
},
};
// Remove configs if there are not secrets passed
if (!process.env.ALGOLIA_KEY || !process.env.ALGOLIA_ID) {
delete module.exports.themeConfig.algolia;
}
if (!process.env.HOTJAR_ID) {
delete module.exports.themeConfig.hotjar;
}