sqlite-vec/site/.vitepress/config.mts

244 lines
6.2 KiB
TypeScript
Raw Normal View History

2024-07-31 12:55:03 -07:00
import { DefaultTheme, defineConfig, HeadConfig } from "vitepress";
2024-05-10 20:49:47 -07:00
import { readFileSync } from "node:fs";
2024-07-31 12:55:03 -07:00
import { dirname, join } from "node:path";
2024-05-10 20:49:47 -07:00
import { fileURLToPath } from "node:url";
const PROJECT = "sqlite-vec";
const description = "A vector search SQLite extension that runs anywhere!";
const VERSION = readFileSync(
join(dirname(fileURLToPath(import.meta.url)), "..", "..", "VERSION"),
"utf8"
);
2024-06-22 16:46:33 -07:00
const sqliteLanuage = JSON.parse(
readFileSync(
join(
dirname(fileURLToPath(import.meta.url)),
"..",
"sqlite.tmlanguage.json"
),
"utf8"
)
);
2024-05-10 20:49:47 -07:00
function head(): HeadConfig[] {
return [
[
"link",
{
rel: "shortcut icon",
type: "image/svg+xml",
2024-06-22 16:46:33 -07:00
href: "./logo.light.svg",
2024-05-10 20:49:47 -07:00
},
],
[
"script",
{
defer: "",
"data-domain": "alexgarcia.xyz/sqlite-vec",
src: "https://plausible.io/js/script.js",
},
],
];
}
const guides = {
text: "Guides",
2024-06-12 00:02:27 -07:00
collapsed: true,
items: [
2024-06-22 16:46:33 -07:00
{ text: "Performance", link: "/guides/performance" },
2024-07-14 13:47:41 -07:00
2024-06-22 16:46:33 -07:00
{
text: "Vector operations",
items: [
{ text: "Vector Arithmetic", link: "/guides/arithmetic" },
{ text: "Binary Quantization", link: "/guides/binary-quant" },
{ text: "Scalar Quantization", link: "/guides/scalar-quant" },
{
text: "Matryoshka Embeddings",
link: "/guides/matryoshka",
},
],
},
2024-08-01 02:45:36 -07:00
/* {
2024-06-22 16:46:33 -07:00
text: "Build with sqlite-vec",
items: [
{ text: "Semantic Search", link: "/guides/semantic-search" },
{ text: "Hybrid Search", link: "/guides/hybrid-search" },
{ text: "Retrival Augmented Generation (RAG)", link: "/guides/rag" },
{ text: "Classifiers", link: "/guides/classifiers" },
],
2024-08-01 02:45:36 -07:00
},*/
2024-06-12 00:02:27 -07:00
],
2024-05-10 20:49:47 -07:00
};
function nav(): DefaultTheme.NavItem[] {
return [
{ text: "API Reference", link: "/api-reference" },
{ text: "♥ Sponsor", link: "https://github.com/sponsors/asg017" },
{
text: `v${VERSION}`,
items: [
{
text: "Github Release",
link: `https://github.com/asg017/${PROJECT}/releases/${VERSION}`,
},
{
text: "Bindings",
items: [
{
text: "Python: PyPi package",
link: `https://pypi.org/project/${PROJECT}`,
},
{
text: "Node.js: NPM package",
link: `https://www.npmjs.com/package/${PROJECT}`,
},
{
text: "Ruby: Ruby gem",
link: `https://rubygems.org/gems/${PROJECT}`,
},
{
text: "Rust: Cargo crate",
link: `https://crates.io/crates/${PROJECT}`,
},
{
2024-07-31 12:55:03 -07:00
text: "Golang: Go module (CGO)",
link: `https://pkg.go.dev/github.com/asg017/${PROJECT}-go-bindings/cgo`,
},
{
text: "Golang: Go module (WASM ncruces)",
link: `https://pkg.go.dev/github.com/asg017/${PROJECT}-go-bindings/ncruces`,
2024-05-10 20:49:47 -07:00
},
{
text: "Datasette: Plugin",
link: `https://datasette.io/plugins/datasette-${PROJECT}`,
},
{
text: "sqlite-utils: Plugin",
link: `https://datasette.io/plugins/datasette-${PROJECT}`,
},
],
},
],
},
];
}
function sidebar(): DefaultTheme.SidebarItem[] {
return [
{
text: "Getting Started",
2024-06-22 16:46:33 -07:00
collapsed: true,
2024-05-10 20:49:47 -07:00
items: [
2024-06-22 16:46:33 -07:00
{
text: "Introduction",
link: "/introduction",
},
2024-07-12 08:50:42 -07:00
{
text: "Installation",
link: "/installation",
},
2024-07-14 13:47:41 -07:00
],
},
2024-07-31 12:55:03 -07:00
2024-05-10 20:49:47 -07:00
{
text: "Using with...",
2024-06-22 16:46:33 -07:00
collapsed: true,
2024-05-10 20:49:47 -07:00
items: [
{ text: "Python", link: "/python" },
2024-06-12 00:02:27 -07:00
{ text: "JavaScript", link: "/js" },
2024-05-10 20:49:47 -07:00
{ text: "Ruby", link: "/ruby" },
{ text: "Rust", link: "/rust" },
{ text: "Go", link: "/go" },
{ text: "C/C++", link: "/c" },
2024-07-31 12:55:03 -07:00
{ text: "Browser (WASM)", link: "/wasm" },
2024-05-10 20:49:47 -07:00
{ text: "Datasette", link: "/datasette" },
{ text: "sqlite-utils", link: "/sqlite-utils" },
2024-08-10 10:31:52 -07:00
{ text: "rqlite", link: "/rqlite" },
2024-09-13 08:20:30 -07:00
{ text: "Android+iOS", link: "/android-ios" },
2024-05-10 20:49:47 -07:00
],
},
2024-07-31 12:55:03 -07:00
{
text: "Features",
collapsed: true,
items: [
{ text: "Vector formats", link: "/features/vector-formats" },
{ text: "KNN queries", link: "/features/knn" },
2024-09-25 22:39:21 -07:00
{ text: "vec0 Virtual Tables", link: "/features/vec0" },
//{ text: "Static blobs", link: "/features/static-blobs" },
2024-07-31 12:55:03 -07:00
],
},
2024-06-12 00:02:27 -07:00
guides,
2024-05-10 20:49:47 -07:00
{
text: "Documentation",
items: [
2024-06-12 00:02:27 -07:00
{ text: "Compiling", link: "/compiling" },
2024-05-10 20:49:47 -07:00
{ text: "API Reference", link: "/api-reference" },
],
},
{
text: "See also",
items: [
{
text: "sqlite-ecosystem",
link: "https://github.com/asg017/sqlite-ecosystem",
},
2024-06-12 00:02:27 -07:00
{
text: "sqlite-lembed",
link: "https://github.com/asg017/sqlite-lembed",
},
{
text: "sqlite-rembed",
link: "https://github.com/asg017/sqlite-rembed",
},
2024-05-10 20:49:47 -07:00
],
},
];
}
// https://vitepress.dev/reference/site-config
export default defineConfig({
2024-06-12 00:02:27 -07:00
title: `${PROJECT}`,
2024-05-10 20:49:47 -07:00
description,
lastUpdated: true,
head: head(),
base: "/sqlite-vec/",
themeConfig: {
2024-06-22 16:46:33 -07:00
logo: {
light: "/logo.dark.svg",
dark: "/logo.light.svg",
alt: "sqlite-vec logo",
},
2024-05-10 20:49:47 -07:00
2024-06-22 16:46:33 -07:00
nav: nav(),
2024-05-10 20:49:47 -07:00
sidebar: sidebar(),
footer: {
2024-06-22 16:46:33 -07:00
message: "MIT/Apache-2 License",
copyright:
'Copyright © 2024 <a href="https://alexgarcia.xyz/">Alex Garcia</a>',
2024-05-10 20:49:47 -07:00
},
outline: "deep",
search: {
provider: "local",
},
socialLinks: [
{ icon: "github", link: `https://github.com/asg017/${PROJECT}` },
2024-08-01 02:45:36 -07:00
{ icon: "discord", link: `https://discord.gg/Ve7WeCJFXk` },
2024-05-10 20:49:47 -07:00
],
editLink: {
pattern: `https://github.com/asg017/${PROJECT}/edit/main/site/:path`,
},
},
rewrites: {
"using/:pkg.md": ":pkg.md",
2024-06-22 16:46:33 -07:00
"getting-started/:pkg.md": ":pkg.md",
//"guides/:pkg.md": ":pkg.md",
2024-05-10 20:49:47 -07:00
},
markdown: {
2024-06-22 16:46:33 -07:00
languages: [sqliteLanuage],
2024-05-10 20:49:47 -07:00
},
});