/
gatsby-config.js
231 lines (226 loc) · 10.4 KB
/
gatsby-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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
module.exports = {
siteMetadata: {
title: `Mind Upgrade`,
description: `The only thing never changes is changing itself.`,
author: `RintarouTW`,
},
plugins: [
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-1860703-8",
// this option places the tracking script into the head of the DOM
head: true,
// other options
},
},
`gatsby-plugin-emotion`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Mind Upgrade`,
short_name: `Markbook`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `standalone`,
icon: `src/images/markbook.svg`, // This path is relative to the root of the site.
theme_color_in_head: false, // This will avoid adding theme-color meta tag.
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
// CommonMark mode (default: true)
commonmark: false,
// Footnotes mode (default: true)
footnotes: false,
// Pedantic mode (default: true)
pedantic: true,
// GitHub Flavored Markdown mode (default: true)
gfm: true,
// Plugins configs
plugins: [
`gatsby-remark-graphviz`,
`gatsby-remark-mathjax`,
`gatsby-remark-autolink-headers`,
`gatsby-remark-containers`,
{
resolve: `gatsby-remark-vscode`, // gfm must be true to work
// All options are optional. Defaults shown here.
options: {
theme: 'Dark+ (default dark)', // Read on for list of included themes. Also accepts object and function forms.
wrapperClassName: '', // Additional class put on 'pre' tag. Also accepts function to set the class dynamically.
injectStyles: true, // Injects (minimal) additional CSS for layout and scrolling
extensions: [], // Third-party extensions providing additional themes and languages
languageAliases: {}, // Map of custom/unknown language codes to standard/known language codes
replaceColor: x => x, // Function allowing replacement of a theme color with another. Useful for replacing hex colors with CSS variables.
getLineClassName: ({ // Function allowing dynamic setting of additional class names on individual lines
content, // - the string content of the line
index, // - the zero-based index of the line within the code fence
language, // - the language specified for the code fence
meta // - any options set on the code fence alongside the language (more on this later)
}) => '',
logLevel: 'warn' // Set to 'info' to debug if something looks wrong
}
},
],
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
// extensions: [".md", ".mdx"], // not support both yet
// CommonMark mode (default: true)
commonmark: false,
// Footnotes mode (default: true)
footnotes: false,
// Pedantic mode (default: true)
pedantic: true,
// GitHub Flavored Markdown mode (default: true)
gfm: true,
defaultLayouts: {
default: require.resolve("./src/components/layout.js"),
},
remarkPlugins: [require(`remark-math`)],
gatsbyRemarkPlugins: [
`gatsby-remark-graphviz`,
`gatsby-remark-autolink-headers`,
// for Server Side Rendering.
// {
// resolve: `gatsby-remark-katex`,
// options: {
// trust: true,
// strict: false,
// delimiters: [
// { left: "$$", right: "$$", display: true },
// { left: "$", right: "$", display: false },
// { left: "\\(", right: "\\)", display: false },
// { left: "\\[", right: "\\]", display: true }
// ],
// macros: {
// "\\eqref": "\\href{#1}{}", // not support yet
// "\\label": "\\href{#1}{}", // not support yet
// "\\require": "\\href{#1}{}", // not support yet
// "\\tag": "\\href{#1}{}", // not support yet
// "\\hfil": "\\space", // not support yet
// "\\def": "\\gdef", // def only work in local context, make it global
// "\\cal": "\\mathcal",
// "\\pmatrix": "\\begin{pmatrix}#1\\end{pmatrix}",
// "\\cases": "\\begin{cases}#1\\end{cases}",
// "\\align": "\\begin{aligned}#1\\end{aligned}",
// "\\eqalign": "\\begin{aligned}#1\\end{aligned}",
// "\\array": "\\begin{array}#1\\end{array}",
// "\\gather": "\\begin{gathered}#1\\end{gathered}",
// } //, output: "hml" / "mathml"
// }
// },
`gatsby-remark-containers`,
// {
// resolve: `gatsby-remark-vscode`, // gfm must be true to work
// // All options are optional. Defaults shown here.
// options: {
// theme: 'Dark+ (default dark)', // Read on for list of included themes. Also accepts object and function forms.
// wrapperClassName: '', // Additional class put on 'pre' tag. Also accepts function to set the class dynamically.
// injectStyles: true, // Injects (minimal) additional CSS for layout and scrolling
// extensions: [], // Third-party extensions providing additional themes and languages
// languageAliases: {}, // Map of custom/unknown language codes to standard/known language codes
// replaceColor: x => x, // Function allowing replacement of a theme color with another. Useful for replacing hex colors with CSS variables.
// getLineClassName: ({ // Function allowing dynamic setting of additional class names on individual lines
// content, // - the string content of the line
// index, // - the zero-based index of the line within the code fence
// language, // - the language specified for the code fence
// meta // - any options set on the code fence alongside the language (more on this later)
// }) => '',
// logLevel: 'warn' // Set to 'info' to debug if something looks wrong
// }
// },
{
resolve: `gatsby-remark-prismjs`,
options: {
// Class prefix for <pre> tags containing syntax highlighting;
// defaults to 'language-' (e.g. <pre class="language-js">).
// If your site loads Prism into the browser at runtime,
// (e.g. for use with libraries like react-live),
// you may use this to prevent Prism from re-processing syntax.
// This is an uncommon use-case though;
// If you're unsure, it's best to use the default value.
classPrefix: "language-",
// This is used to allow setting a language for inline code
// (i.e. single backticks) by creating a separator.
// This separator is a string and will do no white-space
// stripping.
// A suggested value for English speakers is the non-ascii
// character '›'.
inlineCodeMarker: null,
// This lets you set up language aliases. For example,
// setting this to '{ sh: "bash" }' will let you use
// the language "sh" which will highlight using the
// bash highlighter.
aliases: {},
// This toggles the display of line numbers globally alongside the code.
// To use it, add the following line in gatsby-browser.js
// right after importing the prism color scheme:
// require("prismjs/plugins/line-numbers/prism-line-numbers.css")
// Defaults to false.
// If you wish to only show line numbers on certain code blocks,
// leave false and use the {numberLines: true} syntax below
showLineNumbers: false,
// If setting this to true, the parser won't handle and highlight inline
// code used in markdown i.e. single backtick code like `this`.
noInlineHighlight: false,
// This adds a new language definition to Prism or extend an already
// existing language definition. More details on this option can be
// found under the header "Add new language definition or extend an
// existing language" below.
languageExtensions: [
{
language: "superscript",
extend: "javascript",
definition: {
superscript_types: /(SuperType)/,
},
insertBefore: {
function: {
superscript_keywords: /(superif|superelse)/,
},
},
},
],
// Customize the prompt used in shell output
// Values below are default
prompt: {
user: "root",
host: "localhost",
global: false,
},
// By default the HTML entities <>&'" are escaped.
// Add additional HTML escapes by providing a mapping
// of HTML entities and their escape value IE: { '}': '{' }
escapeEntities: {},
},
},
],
},
},
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/templates/typography`,
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
`gatsby-plugin-offline`,
],
}