Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
320 lines (304 loc) · 11.4 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
320 lines (304 loc) · 11.4 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
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
/** @type {import('@docusaurus/types').Config} */
const config = {
noIndex: process.env.WHERE_IS_THIS === "acc" ? true : false,
title: "EverShop",
// Docusaurus already adds a space on each side of the delimiter, so keep it
// as a bare dash. A padded " - " produced "Page - EverShop" (double spaces).
titleDelimiter: "-",
customFields: {
// Put your custom environment here
where_is_this: process.env.WHERE_IS_THIS || "production", // "local", "acc", "production"
// Footer content that is not part of the standard footer config:
// the brand block (tagline + social icons) and the legal links in the bottom bar.
// The link columns live in themeConfig.footer.links. Rendered by src/theme/Footer/Layout.
footer: {
tagline:
"Open-source TypeScript ecommerce platform. Built with React, modular and fully customizable.",
social: [
{
label: "GitHub",
icon: "github",
href: "https://github.com/evershopcommerce/evershop",
},
{
label: "Discord",
icon: "discord",
href: "https://discord.com/invite/GSzt7dt7RM",
},
{ label: "X (Twitter)", icon: "x", href: "https://twitter.com/evershopjs" },
{
label: "LinkedIn",
icon: "linkedin",
href: "https://www.linkedin.com/company/evershop-io",
},
],
legal: [
{ label: "Privacy", to: "/privacy" },
{ label: "Terms", to: "/tos" },
{
label: "License",
href: "https://github.com/evershopcommerce/evershop/blob/main/LICENSE",
},
{ label: "Code of Conduct", to: "/code-of-conduct" },
],
},
},
tagline:
"TypeScript ecommerce platform with essential commerce features. Built with React, modular and fully customizable",
url: "https://evershop.io",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
trailingSlash: false,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "evershopcommerce", // Usually your GitHub org/user name.
projectName: "evershop", // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
plugins: [
"docusaurus-plugin-sass",
"@docusaurus/plugin-ideal-image",
[
"@docusaurus/plugin-google-gtag",
{
trackingID: "G-54D6B5061F",
anonymizeIP: true,
},
],
],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
sidebarItemsGenerator: async function ({
defaultSidebarItemsGenerator,
...ctxArgs
}) {
// get default items
const items = await defaultSidebarItemsGenerator({
...ctxArgs,
});
// helper to walk & inject customProps
const inject = (itemsList) =>
itemsList.map((item) => {
// recurse categories
if (item.type === "category" && Array.isArray(item.items)) {
return {
...item,
items: inject(item.items),
};
}
// items of type 'doc' or 'link' - attach customProps safely
// note: item.docId may contain the doc id
const docId = item?.id ?? item?.docId;
if (docId) {
// find the doc metadata from ctxArgs.docs (docs available in args)
const doc =
(ctxArgs.docs &&
ctxArgs.docs.find((d) => d.id === docId)) ||
null;
if (doc) {
// do not put frontMatter at top-level; use customProps
const customProps = {
...(item.customProps || {}),
frontMatter: doc.frontMatter || {},
// optionally include other metadata:
title: doc.title,
description: doc.description,
};
return {
...item,
customProps,
};
}
}
// fallback: return item unchanged
return item;
});
return inject(items);
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/evershopcommerce/docs/tree/main/",
},
blog: {
blogTitle: "EverShop Blog",
blogDescription:
"What's new in EverShop, and what it means for your store.",
blogSidebarTitle: "Recent posts",
blogSidebarCount: 10,
postsPerPage: 10,
archiveBasePath: null,
showReadingTime: true,
// Posts without a <!-- truncate --> marker render in full on the list
// page. Warn rather than throw so a missing marker is visible in CI
// without blocking a build.
onUntruncatedBlogPosts: "warn",
feedOptions: {
type: "all",
title: "EverShop Blog",
description:
"Release notes, upgrade guides and announcements from the EverShop team.",
copyright: `Copyright © ${new Date().getFullYear()} EverShop.`,
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/evershopcommerce/docs/tree/main/",
},
theme: {
customCss: [
require.resolve("./src/css/fonts.css"),
require.resolve("./src/css/custom.scss"),
],
},
sitemap: {
ignorePatterns: ["/docs/tags/**", "/blog/authors"],
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: "light",
disableSwitch: true,
respectPrefersColorScheme: false,
},
navbar: {
title: "",
logo: {
alt: "EverShop",
src: "img/logo.svg",
width: 35,
height: 35,
},
items: [
{
href: "/documentation",
position: "left",
label: "Docs",
},
{
href: "/extensions",
position: "left",
label: "Marketplace",
},
{
to: "/blog",
position: "left",
label: "Blog",
},
// {
// href: "/pricing",
// position: "left",
// label: "Pricing",
// },
{
href: "/contact-us",
position: "left",
label: "Contact Us",
},
{
type: "html",
position: "right",
value: `<a class="button button--primary button--xs flex items-center align-middle" href="/docs/development/getting-started/introduction"><span>Get started</span> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M3 9H15M15 9L10.5 4.5M15 9L10.5 13.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg></a>`,
},
],
},
footer: {
style: "light",
logo: {
alt: "EverShop",
src: "img/logo.svg",
href: "/",
className: "footer__logo",
},
links: [
{
title: "Product",
items: [
{ label: "Documentation", to: "/documentation" },
{ label: "Marketplace", to: "/extensions" },
{ label: "Release Notes", to: "/blog/tags/release" },
],
},
{
title: "Developers",
items: [
{ label: "Getting Started", to: "/docs/development/getting-started/introduction" },
{ label: "Installation Guide", to: "/docs/development/getting-started/installation-guide" },
{ label: "REST API", to: "/docs/api/overview" },
{ label: "GraphQL", to: "/docs/development/knowledge-base/graphql" },
{ label: "Extension Development", to: "/docs/development/module/extension-overview" },
{ label: "Theme Development", to: "/docs/development/theme/theme-overview" },
{ label: "Function Reference", to: "/docs/development/module/functions" },
],
},
{
title: "Resources",
items: [
{ label: "Blog", to: "/blog" },
{ label: "Knowledge Base", to: "/docs/development/knowledge-base" },
{ label: "Architecture Overview", to: "/docs/development/knowledge-base/architecture-overview" },
{ label: "Deployment Guides", to: "/docs/development/deployment" },
{ label: "Production Checklist", to: "/docs/development/deployment/production-checklist" },
],
},
{
title: "Community",
items: [
{ label: "GitHub", href: "https://github.com/evershopcommerce/evershop" },
{ label: "Discord", href: "https://discord.com/invite/GSzt7dt7RM" },
{ label: "Contribute", href: "https://github.com/evershopcommerce/evershop/blob/main/CONTRIBUTING.md" },
{ label: "Report an Issue", href: "https://github.com/evershopcommerce/evershop/issues/new" },
{ label: "Support Us", to: "/support" },
{ label: "Contact Us", to: "/contact-us" },
],
},
],
copyright: `© ${new Date().getFullYear()} EverShop. Deploys by <a href="https://www.netlify.com" target="_blank" rel="noopener nofollow">Netlify</a>`,
},
// prism: {
// theme: darkTheme,
// },
// Default share image for every page (emits og:image and twitter:image
// with the correct `property` attribute). Pages can override it.
image: "img/social-card.jpg",
algolia: {
// The application ID provided by Algolia
appId: "YOUP0U3MFZ",
// Public API key: it is safe to commit it
apiKey: "d160d70304dd855502e1a83c4a312ad1",
indexName: "evershopio",
// Optional: see doc section below
contextualSearch: true,
// 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)
// No full search results page: the search pop-up is enough.
searchPagePath: false,
//... other Algolia params
},
}),
};
export default config;