-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathdocusaurus.config.ts
230 lines (223 loc) · 6.8 KB
/
docusaurus.config.ts
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
import {themes as prismThemes} from "prism-react-renderer"
import type * as Preset from "@docusaurus/preset-classic"
import prismTheme from "./src/theme/CodeBlock/theme"
import type {Config} from "@docusaurus/types"
import {getNavDropdownItemHtml} from "./src/utils"
const title = "Tailcall"
const organization = "tailcallhq"
const project = "tailcallhq.github.io"
export default {
title,
trailingSlash: true,
tagline: "GraphQL platform engineered for scale",
headTags: [
{
tagName: "script",
attributes: {
id: "chatbotscript",
"data-accountid": "CZPG9aVdtk59Tjz4SMTu8w==",
"data-websiteid": "75VGI0NlBqessD4BQn2pFg==",
src: "https://app.robofy.ai/bot/js/common.js?v=" + new Date().getTime(),
},
},
{
tagName: "script",
attributes: {
type: "application/ld+json",
},
innerHTML: JSON.stringify({
"@context": "https://schema.org/",
"@type": "WebSite",
name: "Tailcall",
url: "https://tailcall.run/",
}),
},
],
url: "https://tailcall.run",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onBrokenAnchors: "throw",
favicon: "images/favicon.ico",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: organization, // Usually your GitHub org/user name.
projectName: project, // Usually your repo name.
deploymentBranch: "main", // Branch that GitHub pages will deploy from.
// 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"],
localeConfigs: {
en: {
label: "English",
},
},
},
future: {
experimental_faster: false, // Required for faster production builds. For reference: https://docusaurus.io/blog/releases/3.6#adoption-strategy
},
presets: [
[
"classic",
/** @type {import("@docusaurus/preset-classic").Options} */
{
docs: {
// docRootComponent: require.resolve("./src/components/docs/Layout.tsx"),
sidebarPath: require.resolve("./sidebars.ts"),
showLastUpdateTime: true,
sidebarCollapsible: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: `https://github.com/${organization}/${project}/tree/develop`,
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
sitemap: {
changefreq: "weekly",
priority: 0.5,
ignorePatterns: ["/blogs/**"],
},
},
],
],
themeConfig: {
// Replace with your project's social card
image: "icons/companies/tailcall.svg",
algolia: {
appId: "X27WDVHRQ3",
apiKey: "35bc100f239853cd8a7195b23ed7393b",
indexName: "tailcall",
contextualSearch: false,
searchParameters: {
facetFilters: [],
},
},
navbar: {
hideOnScroll: true,
logo: {
alt: "My Site Logo",
src: "icons/companies/tailcall.svg",
},
items: [
{to: "/", label: "Home", position: "left", activeBaseRegex: "^/$"},
// {to: "/about", label: "About", position: "left"},
// {to: "/enterprise", label: "Enterprise", position: "left"},
{to: "/blog", label: "Blog", position: "left"},
{
label: "Developers",
position: "left",
items: [
{
to: "/docs",
html: getNavDropdownItemHtml("/images/home/book.svg", "Docs Icon", "Docs"),
},
{
to: "/graphql",
html: getNavDropdownItemHtml("/images/home/archive.svg", "Learn Icon", "Learn"),
},
{
to: "/releases",
html: getNavDropdownItemHtml("/images/home/git-merge.svg", "Releases Icon", "Releases"),
},
],
},
{
type: "search",
position: "right",
className: "hidden lg:flex search-icon-navbar",
},
],
},
prism: {
theme: prismTheme,
darkTheme: prismThemes.dracula,
additionalLanguages: ["protobuf", "json", "diff"],
},
colorMode: {
disableSwitch: true,
defaultMode: "light",
respectPrefersColorScheme: false,
},
tableOfContents: {},
} satisfies Preset.ThemeConfig,
plugins: [
[
"./plugins/custom-blog-plugin.ts",
{
path: "blog",
editLocalizedFiles: false,
blogTitle: "Feed of Tailcall blogs",
blogDescription: "List of blog posts on Tailcall blog",
blogSidebarCount: 10,
blogSidebarTitle: "Recent Blog Posts",
routeBasePath: "blog",
include: ["**/*.{md,mdx}"],
exclude: ["**/_*.{js,jsx,ts,tsx,md,mdx}", "**/_*/**", "**/*.test.{js,jsx,ts,tsx}", "**/__tests__/**"],
postsPerPage: "ALL",
blogListComponent: "@theme/BlogListPage",
blogPostComponent: "@theme/BlogPostPage",
blogTagsListComponent: "@theme/BlogTagsListPage",
blogTagsPostsComponent: "@theme/BlogTagsPostsPage",
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
truncateMarker: /<!--\s*(truncate)\s*-->/,
showReadingTime: true,
feedOptions: {
type: "all",
copyright: `Copyright © ${new Date().getFullYear()} Tailcall, Inc.`,
},
onInlineAuthors: "throw",
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "privacy",
path: "privacy",
routeBasePath: "privacy",
showLastUpdateTime: true,
sidebarPath: require.resolve("./privacy/sidebar.ts"),
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "graphql",
path: "graphql",
routeBasePath: "graphql",
showLastUpdateTime: true,
sidebarPath: require.resolve("./graphql/sidebar.ts"),
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "releases",
path: "releases",
routeBasePath: "releases",
showLastUpdateTime: true,
async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}: any) {
const sidebarItems = await defaultSidebarItemsGenerator(args)
return sidebarItems.reverse()
},
},
],
async function tailwindPlugin() {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
return {
...postcssOptions,
plugins: [...postcssOptions.plugins, require("tailwindcss"), require("autoprefixer")],
}
},
}
},
],
} satisfies Config