-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
102 lines (90 loc) · 3.01 KB
/
docusaurus.config.js
File metadata and controls
102 lines (90 loc) · 3.01 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
// @ts-check
const theme = require("prism-react-renderer/themes/github");
const darkTheme = require("prism-react-renderer/themes/dracula");
const math = require("remark-math");
const katex = require("rehype-katex");
const title = "SML Help";
const org = "smlhelp";
const repo = "book";
const github = `https://github.com/${org}/${repo}`;
/** @type {import('@docusaurus/types').Config} */
const config = {
title,
tagline: "A resource for learning Standard ML",
url: `https://${org}.github.io`,
baseUrl: `/${repo}/`,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
organizationName: org,
projectName: repo,
trailingSlash: true,
i18n: {
defaultLocale: "en",
locales: ["en"],
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
docs: { remarkPlugins: [math], rehypePlugins: [katex] },
}),
],
],
// themes: ['@docusaurus/theme-search-algolia'],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title,
items: [
{
href: github,
label: "GitHub",
position: "right",
},
],
},
prism: {
theme,
darkTheme,
additionalLanguages: ["sml", "vim"],
},
algolia: {
// The application ID provided by Algolia
appId: 'XNI9A5Z2CN',
// Public API key: it is safe to commit it
apiKey: '5b35780ea0596402725411ca0bf319b0',
indexName: 'smlhelp',
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
// externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
// replaceSearchResultPathname: {
// from: '/docs/', // or as RegExp: /\/docs\//
// to: '/',
// },
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
//... other Algolia params
},
}),
// TODO figure out how to get the katex css without CDN (should already be
// in node_modules)
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css",
type: "text/css",
integrity:
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
crossorigin: "anonymous",
},
],
};
module.exports = config;