Skip to content

Commit d9965f8

Browse files
authored
chore: revamp docs hero page. (#1959)
* ... * ... * ... * ... * ... * ... * ... * ... * ...
1 parent ff15048 commit d9965f8

34 files changed

Lines changed: 38523 additions & 600 deletions

pnpm-lock.yaml

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/docs/intro.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
sidebar_position: 1
33
---
44

5-
import { DemoVideo } from '@site/src/components/DemoVideo'
6-
75
# Introduction
86

97
Kysely (pronounced “Key-Seh-Lee”) is a type-safe and autocompletion-friendly TypeScript SQL query builder. Inspired by Knex. Mainly developed for [node.js](https://nodejs.org/en/) but also
108
runs on all other JavaScript environments like [deno](https://deno.land/) and [bun](https://bun.sh/).
119

12-
<DemoVideo />
13-
1410
Kysely makes sure you only refer to tables and columns that are visible to the part of the query you're writing. The result type only has the selected columns with correct types and aliases. As an added bonus you get autocompletion for all that stuff.
1511

16-
As shown in the gif above, through the pure magic of modern TypeScript, Kysely is even able to parse the alias given to `pet.name` and add the `pet_name` column to the result row type. Kysely is able to infer column names, aliases and types from selected subqueries, joined subqueries, `with` statements and pretty much anything you can think of.
12+
Through the pure magic of modern TypeScript, Kysely is even able to parse the alias given to `pet.name` and add the `pet_name` column to the result row type. Kysely is able to infer column names, aliases and types from selected subqueries, joined subqueries, `with` statements and pretty much anything you can think of.
1713

1814
Of course there are cases where things cannot be typed at compile time, and Kysely offers escape hatches for these situations. See the [sql template tag](https://kysely-org.github.io/kysely-apidoc/interfaces/Sql.html) and the [DynamicModule](https://kysely-org.github.io/kysely-apidoc/classes/DynamicModule.html#ref) for more info.
1915

site/docusaurus.config.ts

Lines changed: 50 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ import type { MermaidConfig } from 'mermaid'
77
import { themes } from 'prism-react-renderer'
88
import type { PluginOptions as LLMsTXTPluginOptions } from '@signalwire/docusaurus-plugin-llms-txt'
99
import type { PluginOptions as VercelAnalyticsPluginOptions } from '@docusaurus/plugin-vercel-analytics'
10+
import { socialIconPaths } from './src/components/socialIconPaths'
11+
12+
function socialNavbarItem(
13+
label: string,
14+
href: string,
15+
icon: { d: string; evenOdd?: boolean; viewBox: string },
16+
) {
17+
const pathRules = icon.evenOdd
18+
? ' fill-rule="evenodd" clip-rule="evenodd"'
19+
: ''
20+
21+
return {
22+
position: 'right' as const,
23+
type: 'html' as const,
24+
value: `<a class="navbar-social" href="${href}" target="_blank" rel="noopener noreferrer" aria-label="${label}"><svg viewBox="${icon.viewBox}" xmlns="http://www.w3.org/2000/svg"><path${pathRules} d="${icon.d}"/></svg></a>`,
25+
}
26+
}
1027

1128
export default {
1229
baseUrl: '/',
@@ -109,72 +126,14 @@ export default {
109126
hideable: true,
110127
},
111128
},
129+
// Minimal VitePress-style footer. Vercel badge stays: they host us for
130+
// free.
112131
footer: {
113-
links: [
114-
{
115-
items: [
116-
{ label: 'Introduction', to: '/docs/intro' },
117-
{ label: 'Getting started', to: '/docs/getting-started' },
118-
{ label: 'Playground', to: '/docs/playground' },
119-
{ label: 'Migrations', to: '/docs/migrations' },
120-
// { label: 'Examples', to: '/docs/category/examples' },
121-
{ label: 'Recipes', to: '/docs/category/recipes' },
122-
{ label: 'Other runtimes', to: '/docs/category/other-runtimes' },
123-
{ label: 'Dialects', to: '/docs/dialects' },
124-
{ label: 'Generating types', to: '/docs/generating-types' },
125-
{ label: 'Plugin system', to: '/docs/plugins' },
126-
],
127-
title: 'Docs',
128-
},
129-
{
130-
items: [
131-
{ label: 'SELECT', to: '/docs/category/select' },
132-
{ label: 'WHERE', to: '/docs/category/where' },
133-
{ label: 'JOIN', to: '/docs/category/join' },
134-
{ label: 'INSERT', to: '/docs/category/insert' },
135-
{ label: 'UPDATE', to: '/docs/category/update' },
136-
{ label: 'DELETE', to: '/docs/category/delete' },
137-
{ label: 'Transactions', to: '/docs/category/transactions' },
138-
{ label: 'CTE', to: '/docs/category/cte' },
139-
],
140-
title: 'Examples',
141-
},
142-
{
143-
items: [
144-
{
145-
label: 'Discord',
146-
href: 'https://discord.gg/xyBJ3GwvAm',
147-
},
148-
{
149-
label: 'Bluesky',
150-
href: 'https://bsky.app/profile/kysely.dev',
151-
},
152-
],
153-
title: 'Community',
154-
},
155-
{
156-
items: [
157-
{
158-
label: 'GitHub',
159-
href: 'https://github.com/kysely-org/kysely',
160-
},
161-
{
162-
label: 'API docs',
163-
href: 'https://kysely-org.github.io/kysely-apidoc/',
164-
},
165-
],
166-
title: 'Other',
167-
},
168-
{
169-
items: [
170-
{
171-
html: `<a href="https://vercel.com/?utm_source=kysely&utm_campaign=oss"><img src="/img/powered-by-vercel.svg" style="width: 214px; height: 44px" alt="Powered by Vercel" /></a>`,
172-
},
173-
],
174-
title: 'Sponsors',
175-
},
176-
],
177-
style: 'dark',
132+
copyright: [
133+
`Released under the MIT License.`,
134+
`Copyright © 2022-present Sami Koskimäki & Kysely contributors.`,
135+
`<a class="footer-vercel" href="https://vercel.com/?utm_source=kysely&utm_campaign=oss" target="_blank" rel="noopener noreferrer"><img src="/img/powered-by-vercel.svg" width="176" height="36" alt="Powered by Vercel" /></a>`,
136+
].join('<br/>'),
178137
},
179138
headTags: [
180139
{
@@ -228,37 +187,59 @@ export default {
228187
],
229188
navbar: {
230189
items: [
190+
{
191+
position: 'left',
192+
type: 'search',
193+
},
231194
{
232195
docId: 'intro',
233196
label: 'Docs',
234-
position: 'left',
197+
position: 'right',
235198
type: 'doc',
236199
},
237200
{
238-
href: 'https://github.com/kysely-org/kysely',
239-
label: 'GitHub',
201+
href: 'https://play.kysely.dev',
202+
label: 'Playground',
240203
position: 'right',
241204
},
242205
{
243206
href: 'https://kysely-org.github.io/kysely-apidoc',
244207
label: 'API docs',
245208
position: 'right',
246209
},
210+
{
211+
...socialNavbarItem(
212+
'GitHub',
213+
'https://github.com/kysely-org/kysely',
214+
socialIconPaths.github,
215+
),
216+
className: 'navbar-group-start',
217+
},
218+
socialNavbarItem(
219+
'Discord',
220+
'https://discord.gg/xyBJ3GwvAm',
221+
socialIconPaths.discord,
222+
),
223+
socialNavbarItem(
224+
'Bluesky',
225+
'https://bsky.app/profile/kysely.dev',
226+
socialIconPaths.bluesky,
227+
),
247228
],
248229
logo: {
249230
alt: 'Kysely Logo',
250231
height: 32,
251232
src: 'img/logo.svg',
252233
width: 32,
253234
},
254-
style: 'dark',
255235
title: 'Kysely',
256236
},
257237
prism: {
258238
darkTheme: themes.dracula,
259239
theme: themes.github,
260240
},
261241
} satisfies PresetClassicThemeConfig,
242+
clientModules: ['./src/clientModules/navbarScroll.ts'],
262243
themes: ['@docusaurus/theme-mermaid'],
263244
title: 'Kysely',
264245
url: 'https://kysely.dev',

site/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"scripts": {
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
8-
"build": "docusaurus build",
8+
"build": "pnpm snippets && docusaurus build",
9+
"snippets": "node scripts/highlight-snippets.mjs",
10+
"proof-links": "node scripts/verify-proof-links.mjs",
911
"swizzle": "docusaurus swizzle",
1012
"deploy": "docusaurus deploy",
1113
"clear": "docusaurus clear",
@@ -34,6 +36,7 @@
3436
"@signalwire/docusaurus-plugin-llms-txt": "1.2.2",
3537
"@types/react": "19.2.17",
3638
"mermaid": "11.16.0",
39+
"shiki": "4.3.1",
3740
"typescript": "7.0.2"
3841
},
3942
"browserslist": {

0 commit comments

Comments
 (0)