-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
352 lines (336 loc) · 17.8 KB
/
Copy pathindex.js
File metadata and controls
352 lines (336 loc) · 17.8 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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
// @ts-nocheck
// Shared Docusaurus config for all StackQL web properties.
//
// This module is vendored (git-cloned) by each site, not installed via yarn.
// It MUST NOT import any external package - that would fail to resolve under
// Yarn Berry PnP, since the vendored folder declares no dependencies.
// Anything needing an installed package (currently only `prism-react-renderer`)
// is passed in by the site wrapper as a parameter.
const MAIN_SITE = 'https://stackql.io';
const providerOrigin = (name) => `https://${name}-provider.stackql.io`;
// Provider slugs that get a local /providers/<slug> redirect to their
// microsite. Order here drives the navbar dropdown order.
const PROVIDER_SLUGS = [
'aws',
'azure',
'google',
'databricks',
'snowflake',
'confluent',
'okta',
'github',
'openai',
'cloudflare',
];
const PROVIDER_LABELS = {
aws: 'AWS',
azure: 'Azure',
google: 'Google',
databricks: 'Databricks',
snowflake: 'Snowflake',
confluent: 'Confluent',
okta: 'Okta',
github: 'GitHub',
openai: 'OpenAI',
cloudflare: 'Cloudflare',
};
const awsSvg =
`<svg preserveAspectRatio="none" width="30" height="20" viewBox="14.7 23 42 26.2" xmlns="http://www.w3.org/2000/svg"><polygon points="27.09 35.764 25.984 40.34 28.182 40.34 27.115 35.764" fill="#F7981F"/><path d="m16.302 40.744v0.666c0 3.311 3.579 6.66 7.991 6.66h23.533c4.412 0 7.991-3.35 7.991-6.66v-0.666c0-3.078-3.098-6.943-7.081-7.283-0.089-2.752-2.342-4.955-5.113-4.955-1.076 0-2.074 0.334-2.898 0.9-1.58-3.52-5.107-5.977-9.216-5.977-5.579 0-10.101 4.521-10.101 10.102 0 0.1 0.012 0.195 0.015 0.293-2.993 0.867-5.121 4.371-5.121 6.92zm12.699 3.055l-0.572-2.275h-2.717l-0.599 2.275h-1.547l2.639-9.283h1.898l2.444 9.283h-1.546zm9.012 0h-1.716l-1.196-6.994h-0.026l-1.183 6.994h-1.716l-1.795-9.283h1.496l1.221 7.215h0.027l1.221-7.215h1.561l1.248 7.254h0.026l1.209-7.254h1.469l-1.846 9.283zm5.433 0.181c-2.301 0-2.821-1.533-2.821-2.834v-0.221h1.482v0.234c0 1.131 0.494 1.703 1.521 1.703 0.936 0 1.403-0.664 1.403-1.354 0-0.975-0.493-1.404-1.325-1.65l-1.015-0.352c-1.353-0.52-1.937-1.221-1.937-2.547 0-1.691 1.144-2.627 2.886-2.627 2.379 0 2.626 1.482 2.626 2.443v0.209h-1.482v-0.195c0-0.846-0.377-1.34-1.3-1.34-0.637 0-1.248 0.352-1.248 1.34 0 0.793 0.403 1.195 1.392 1.572l1 0.365c1.313 0.467 1.886 1.184 1.886 2.457 1e-3 1.979-1.196 2.797-3.068 2.797z" fill="#F7981F"/><path d="m26.205 34.516l-2.639 9.283h1.547l0.599-2.275h2.717l0.572 2.275h1.547l-2.444-9.283h-1.899zm-0.221 5.824l1.105-4.576h0.025l1.066 4.576h-2.196z" fill="#fff"/><polygon points="37.181 41.77 37.154 41.77 35.906 34.516 34.346 34.516 33.125 41.73 33.098 41.73 31.877 34.516 30.381 34.516 32.176 43.799 33.892 43.799 35.074 36.805 35.101 36.805 36.297 43.799 38.013 43.799 39.858 34.516 38.39 34.516" fill="#fff"/><path d="m44.629 38.729l-1-0.365c-0.988-0.377-1.392-0.779-1.392-1.572 0-0.988 0.611-1.34 1.248-1.34 0.923 0 1.3 0.494 1.3 1.34v0.195h1.482v-0.209c0-0.961-0.247-2.443-2.626-2.443-1.742 0-2.886 0.936-2.886 2.627 0 1.326 0.584 2.027 1.937 2.547l1.015 0.352c0.832 0.246 1.325 0.676 1.325 1.65 0 0.689-0.468 1.354-1.403 1.354-1.027 0-1.521-0.572-1.521-1.703v-0.234h-1.482v0.221c0 1.301 0.521 2.834 2.821 2.834 1.872 0 3.068-0.818 3.068-2.795 0-1.276-0.573-1.993-1.886-2.459z" fill="#fff"/></svg>`;
const azureSvg =
`<svg width="20" height="20" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="e399c19f-b68f-429d-b176-18c2117ff73c" x1="-1032.172" x2="-1059.213" y1="145.312" y2="65.426" gradientTransform="matrix(1 0 0 -1 1075 158)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#114a8b"/><stop offset="1" stop-color="#0669bc"/></linearGradient><linearGradient id="ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15" x1="-1023.725" x2="-1029.98" y1="108.083" y2="105.968" gradientTransform="matrix(1 0 0 -1 1075 158)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-opacity=".3"/><stop offset=".071" stop-opacity=".2"/><stop offset=".321" stop-opacity=".1"/><stop offset=".623" stop-opacity=".05"/><stop offset="1" stop-opacity="0"/></linearGradient><linearGradient id="a7fee970-a784-4bb1-af8d-63d18e5f7db9" x1="-1027.165" x2="-997.482" y1="147.642" y2="68.561" gradientTransform="matrix(1 0 0 -1 1075 158)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3ccbf4"/><stop offset="1" stop-color="#2892df"/></linearGradient></defs><path fill="url(#e399c19f-b68f-429d-b176-18c2117ff73c)" d="M33.338 6.544h26.038l-27.03 80.087a4.152 4.152 0 0 1-3.933 2.824H8.149a4.145 4.145 0 0 1-3.928-5.47L29.404 9.368a4.152 4.152 0 0 1 3.934-2.825z"/><path fill="#0078d4" d="M71.175 60.261h-41.29a1.911 1.911 0 0 0-1.305 3.309l26.532 24.764a4.171 4.171 0 0 0 2.846 1.121h23.38z"/><path fill="url(#ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)" d="M33.338 6.544a4.118 4.118 0 0 0-3.943 2.879L4.252 83.917a4.14 4.14 0 0 0 3.908 5.538h20.787a4.443 4.443 0 0 0 3.41-2.9l5.014-14.777 17.91 16.705a4.237 4.237 0 0 0 2.666.972H81.24L71.024 60.261l-29.781.007L59.47 6.544z"/><path fill="url(#a7fee970-a784-4bb1-af8d-63d18e5f7db9)" d="M66.595 9.364a4.145 4.145 0 0 0-3.928-2.82H33.648a4.146 4.146 0 0 1 3.928 2.82l25.184 74.62a4.146 4.146 0 0 1-3.928 5.472h29.02a4.146 4.146 0 0 0 3.927-5.472z"/></svg>`;
const TwitterSvg =
`<svg style="fill: #1DA1F2; vertical-align: middle;" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>`;
const providersAnnouncement = `${azureSvg} Microsoft Azure and ${awsSvg} AWS providers for StackQL available now`;
const gitHubStarAccouncement = `<b>If you like StackQL, give it a ⭐️ on <a target="_blank" rel="noopener noreferrer" href="https://github.com/stackql/stackql">GitHub</a> and follow us on <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/stackql" >Twitter</a></b> ${TwitterSvg}`;
const hacktoberfestAccouncement = `<b>🎃 Join us for <a target="_blank" rel="noopener noreferrer" href="https://github.com/stackql/stackql/issues?q=is%3Aissue+is%3Aopen+label%3Ahacktoberfest">Hacktoberfest</a>`;
// Shared paths registered locally on every consumer site by the
// redirectsPlugin below. Each entry registers a route at the consumer site
// that client-side-redirects to the target. Items can then use `to:` instead
// of `href:`, which keeps them looking internal (no external-link icon) and
// makes typed/bookmarked URLs land on the right page instead of 404ing.
//
// Three groups of redirects:
// - top-level shared destinations on the main site (Install, Blog, etc.)
// - deep doc paths on the main site (AI Agents children)
// - one per provider, pointing at that provider's microsite
//
// The /providers top-level entry targets the docs index on the main site,
// not the marketing page.
const REDIRECTS = {
'/install': `${MAIN_SITE}/install`,
'/ai-agents': `${MAIN_SITE}/ai-agents`,
'/stackql-deploy': `${MAIN_SITE}/stackql-deploy`,
'/providers': `${MAIN_SITE}/docs/providers`,
'/blog': `${MAIN_SITE}/blog`,
'/tutorials': `${MAIN_SITE}/tutorials`,
'/contact-us': `${MAIN_SITE}/contact-us`,
'/stackqldocs': `${MAIN_SITE}/stackqldocs`,
'/docs/command-line-usage/mcp': `${MAIN_SITE}/docs/command-line-usage/mcp`,
'/docs/mcp': `${MAIN_SITE}/docs/mcp`,
...Object.fromEntries(
PROVIDER_SLUGS.map((s) => [`/providers/${s}`, `${providerOrigin(s)}/`]),
),
};
// Built from PROVIDER_SLUGS so the dropdown and the redirect map can't drift
// apart. Each item navigates locally to /providers/<slug>, which the plugin
// then redirects to the provider microsite.
const providerDropDownListItems = [
...PROVIDER_SLUGS.map((s) => ({ label: PROVIDER_LABELS[s], to: `/providers/${s}` })),
{ label: '... More', to: '/providers' },
];
const footerStackQLItems = [
{ label: 'Documentation', to: '/stackqldocs' },
{ label: 'Install', to: '/install' },
{ label: 'Contact us', to: '/contact-us' },
];
const footerMoreItems = [
{ label: 'Providers', to: '/providers' },
{ label: 'stackql-deploy', to: '/stackql-deploy' },
{ label: 'Blog', to: '/blog' },
{ label: 'Tutorials', to: '/tutorials' },
];
// Docusaurus plugin: register a client-side redirect route for each entry in
// REDIRECTS. The Redirect component lives at @site/.shared-config/components,
// which resolves via Docusaurus's @site alias to the consumer site's root,
// where this repo has been vendored.
function redirectsPlugin() {
return {
name: 'stackql-shared-redirects',
async contentLoaded({ actions }) {
const { addRoute, createData } = actions;
for (const [from, to] of Object.entries(REDIRECTS)) {
const dataPath = await createData(
`redirect${from.replace(/\//g, '_')}.json`,
JSON.stringify({ to }),
);
addRoute({
path: from,
component: '@site/.shared-config/components/Redirect.js',
modules: { target: dataPath },
exact: true,
});
}
},
};
}
function createConfig({ providerName, providerTitle, prismThemes, overrides = {} }) {
if (!providerName || !providerTitle) {
throw new Error('createConfig requires providerName and providerTitle');
}
if (!prismThemes) {
throw new Error('createConfig requires prismThemes (pass `themes` from prism-react-renderer)');
}
// providerName is SQL-identifier-shaped (may contain underscores, e.g.
// 'entra_id'). Underscores aren't valid in DNS labels, so derive a slug for
// URLs and hostnames. providerName itself stays unchanged in user-visible
// text (titles, labels, keywords) where the underscore is correct.
//
// providerRepo is the GitHub repo name under stackql-registry, which uses
// neither separator (e.g. 'entra_id' -> 'entraid').
const providerSlug = providerName.replace(/_/g, '-');
const providerRepo = providerName.replace(/_/g, '');
const lightCodeTheme = prismThemes.github;
const darkCodeTheme = prismThemes.dracula;
const nightOwlCodeTheme = prismThemes.nightOwl;
const config = {
title: `StackQL ${providerTitle} Provider`,
staticDirectories: ['static'],
tagline: `Query and Provision ${providerTitle} Resources using StackQL`,
url: `https://${providerSlug}-provider.stackql.io`,
baseUrl: '/',
onBrokenLinks: 'warn',
favicon: '/favicon.ico',
organizationName: 'stackql',
projectName: `stackql-provider-${providerRepo}`,
baseUrlIssueBanner: false,
trailingSlash: false,
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
headTags: [
{ tagName: 'link', attributes: { rel: 'preconnect', href: 'https://fonts.googleapis.com' } },
{ tagName: 'link', attributes: { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous' } },
{ tagName: 'link', attributes: { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' } },
{ tagName: 'link', attributes: { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' } },
{ tagName: 'link', attributes: { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' } },
{ tagName: 'link', attributes: { rel: 'manifest', href: '/site.webmanifest' } },
{ tagName: 'link', attributes: { rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#0f4c81' } },
{
tagName: 'script',
attributes: { type: 'application/ld+json' },
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
'name': `StackQL ${providerTitle} Provider`,
'description': `Query and Provision ${providerTitle} Resources using StackQL`,
'applicationCategory': 'DeveloperApplication',
'operatingSystem': 'Cross-platform',
'offers': { '@type': 'Offer', 'price': '0', 'priceCurrency': 'USD' },
}),
},
],
plugins: [
'@docusaurus/plugin-ideal-image',
redirectsPlugin,
],
presets: [
[
'@docusaurus/preset-classic',
{
gtag: {
trackingID: 'G-M7GH68KJ3F',
anonymizeIP: true,
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/search'],
filename: 'sitemap.xml',
},
pages: {},
docs: {
sidebarPath: './sidebars.js',
path: 'docs',
routeBasePath: '/',
sidebarCollapsible: true,
showLastUpdateTime: false,
editUrl: `https://github.com/stackql-registry/stackql-provider-${providerRepo}/edit/main/`,
},
blog: false,
theme: {
customCss: './src/css/global.css',
},
},
],
],
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
themes: ['@docusaurus/theme-mermaid'],
themeConfig: {
metadata: [
{ name: 'robots', content: 'index,follow' },
{ name: 'keywords', content: `stackql, sql, ${providerName}, ${providerTitle.toLowerCase()}, ai agents, agentic ai, infrastructure as code, cloud services, api, devops, control plane, data plane` },
{ name: 'twitter:site', content: '@stackql' },
{ name: 'twitter:creator', content: '@stackql' },
{ name: 'twitter:title', content: `StackQL ${providerTitle} Provider` },
{ name: 'twitter:description', content: `Query and Provision ${providerTitle} Resources using StackQL` },
{ name: 'og:locale', content: 'en_US' },
{ name: 'og:site_name', content: `StackQL ${providerTitle} Provider` },
{ name: 'msapplication-TileColor', content: '#2d89ef' },
{ name: 'theme-color', content: '#ffffff' },
],
// Announcement bar disabled for now - reinstate by uncommenting.
// announcementBar: {
// id: 'support_us',
// content: hacktoberfestAccouncement,
// backgroundColor: '#A9BCD0',
// textColor: '#1A4E82',
// isCloseable: true,
// },
// announcementBarActive: false,
// announcementBarLink: 'https://github.com/stackql/stackql',
image: '/img/stackql-featured-image.png',
docs: {
sidebar: {
hideable: true,
},
},
navbar: {
logo: {
alt: 'StackQL',
// Logo points at the microsite's own root (provider intro page).
// navbar.logo only accepts `href:`; a relative href stays internal.
href: '/',
// Logo image is served from the main site so microsites don't have
// to vendor it.
src: `${MAIN_SITE}/img/logo-original.svg`,
srcDark: `${MAIN_SITE}/img/logo-white.svg`,
},
items: [
{
to: '/install',
label: 'Install',
position: 'left',
},
{
type: 'dropdown',
label: 'AI Agents',
position: 'left',
// MCP server CLI doc and MCP tools index - two distinct main-site
// pages. Registered in REDIRECTS so they appear local.
items: [
{ to: '/docs/command-line-usage/mcp', label: 'MCP Server' },
{ to: '/docs/mcp', label: 'MCP Tools' },
],
},
{
to: '/stackql-deploy',
label: 'stackql-deploy',
position: 'left',
},
{
to: '/providers',
type: 'dropdown',
label: 'Providers',
position: 'left',
items: providerDropDownListItems,
},
{
type: 'dropdown',
label: 'More',
position: 'left',
items: [
{ to: '/blog', label: 'Blog' },
{ to: '/tutorials', label: 'Tutorials' },
],
},
{
href: 'https://github.com/stackql/stackql',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'StackQL',
// Footer logo matches the navbar logo: points at the microsite's
// own root, image served from the main site.
href: '/',
src: `${MAIN_SITE}/img/logo-original.svg`,
srcDark: `${MAIN_SITE}/img/logo-white.svg`,
},
links: [
{ title: 'StackQL', items: footerStackQLItems },
{ title: 'More', items: footerMoreItems },
],
copyright: `© ${new Date().getFullYear()} StackQL Studios ABN 65 656 147 054`,
},
colorMode: {
respectPrefersColorScheme: true,
},
prism: {
additionalLanguages: ['powershell'],
darkTheme: darkCodeTheme,
theme: (() => {
const theme = nightOwlCodeTheme;
// Differentiate YAML keys from values in the nightOwl palette.
theme.styles.push({
types: ['atrule'],
style: { color: 'rgb(255, 203, 139)' },
});
return theme;
})(),
},
},
};
return { ...config, ...overrides };
}
module.exports = { createConfig };