forked from casper-network/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
121 lines (118 loc) · 4.52 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
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
require("dotenv").config({
path: process.env.NODE_ENV ? `.env.${process.env.NODE_ENV}` : `.env`,
});
const {
algoliaConfig,
algoliaOfflineConfig,
announcementConfig,
colorConfig,
dataConfig,
footerConfig,
gtagConfig,
gtmConfig,
i18nConfig,
metadatasConfig,
navbarConfig,
pwaConfig,
prismConfig,
siteConfig,
siteNavbarConfig,
} = require("./config");
const { getEditUrl } = require("./src/utils/docs");
const docsOnlyMode = process.env.DOCS_MODE || true;
const routePrefix = !docsOnlyMode ? "/docs" : "/";
module.exports = {
...siteConfig,
i18n: i18nConfig,
baseUrl: "/",
/* Optional */
customFields: {
// customFields: dataConfig,
...siteNavbarConfig,
},
scripts: [{ src: "/js/loadtags.js", async: true, type: "module" }],
themeConfig: {
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 6,
},
...(algoliaConfig["apiKey"] && { algolia: algoliaConfig }),
// announcementBar: announcementConfig,
colorMode: colorConfig,
footer: footerConfig,
docs: {
sidebar: {
hideable: true,
},
},
/* Optional */
// metadatas: metadatasConfig,
navbar: navbarConfig,
prism: prismConfig,
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
// remarkPlugins: [],
path: "source/docs/casper",
routeBasePath: routePrefix, // IMPORTANT: Turn on docs-only mode
sidebarPath: require.resolve("./config/sidebar.config.js"),
editUrl: getEditUrl,
exclude: ["./contract-dsl/archived", "./economics/archived", "./theory"],
/* Docs config options */
// showLastUpdateAuthor: false,
showLastUpdateTime: true,
// remarkPlugins: [require("@react-native-website/remark-snackplayer")],
// editCurrentVersion: true,
// onlyIncludeVersions: process.env.PREVIEW_DEPLOY === "true" ? ["current", ...versions.slice(0, 2)] : undefined,
},
//...(gtagConfig["trackingID"] && { gtag: gtagConfig }),
...(gtmConfig["containerId"] && { googleTagManager: gtmConfig }),
// IMPORTANT: disable blog feature
blog: false,
/* Blog config options */
// {
// showReadingTime: true,
// editUrl: "https://github.com/casper-network/documentation/blob/master/blog",
// path: "blog",
// blogSidebarCount: "ALL",
// blogSidebarTitle: "All Blog Posts",
// feedOptions: {
// type: "all",
// copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
// },
// },
theme: {
customCss: [require.resolve("./src/assets/scss/theme.scss")],
},
},
],
],
plugins: [
"docusaurus-plugin-sass",
/* Optional */
// ["@docusaurus/plugin-pwa", pwaConfig],
[
"docusaurus-plugin-navdata",
{
directusUrl: process.env.DIRECTUS_URL,
directusGraphqlUrl: process.env.DIRECTUS_GRAPHQL_URL,
directusToken: process.env.DIRECTUS_TOKEN,
query:
"query { header { translations { languages_code { code } login_text search_placeholder logo { id } navigation_tree } } social_media { name url icon { id } } footer { translations { title description manage_cookies_text logo { id title } bottom_links { link_id { title type url open_in_new_tab } } languages_code { code } footer_tree }}}",
},
],
[
"docusaurus-plugin-cookiesbanner",
{
directusUrl: process.env.DIRECTUS_URL,
directusGraphqlUrl: process.env.DIRECTUS_GRAPHQL_URL,
directusToken: process.env.DIRECTUS_TOKEN,
query:
"query { cookie_banner { translations { languages_code { code } items { cookie_item_id { required parameter title description } } manage_body manage_title notice_body notice_title manage_button_text accept_all_button_text confirm_button_text } } }",
},
],
],
};