Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate documentation from Nextra to Vitepress #563

Merged
merged 10 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 155 additions & 2 deletions packages/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,156 @@
node_modules
# Created by https://www.toptal.com/developers/gitignore/api/node,vue
# Edit at https://www.toptal.com/developers/gitignore?templates=node,vue

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
.env.local
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist
.vitepress/dist
.vitepress/cache
# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

### Vue ###
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore

# TODO: where does this rule come from?
docs/_book

# TODO: where does this rule come from?
test/

# End of https://www.toptal.com/developers/gitignore/api/node,vue
179 changes: 179 additions & 0 deletions packages/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import { defineConfig } from 'vitepress'
import { OramaSearch } from '../plugins/searchbox/index.ts'

// https://vitepress.dev/reference/site-config
export default defineConfig({
lang: 'en-US',
title: 'Orama Docs',
description: 'Search, everywhere',
lastUpdated: true,
cleanUrls: true,

head: [
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }],
['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' }],
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' }],
['link', { rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#3a0839'}],
['meta', { name: 'theme-color', content: '#000'}],
],

sitemap: {
hostname: 'https://docs.oramasearch.com'
},

vite: {
plugins: [OramaSearch()]
},

rewrites: {
'/open-source': '/open-source/index',
'/cloud': '/cloud/index',
},

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: {
dark: '/logo-orama-dark.svg',
light: '/logo-orama-light.svg'
},

siteTitle: false,

editLink: {
pattern: 'https://github.com/oramasearch/orama/edit/main/packages/docs/:path',
text: 'Edit this page on GitHub'
},

nav: [
{ text: 'Open Source', link: '/open-source/index.html' },
{ text: 'Orama Cloud', link: '/cloud/index.html' }
],

sidebar: {
'/open-source/': [
{
text: 'Usage',
collapsed: false,
items: [
{ text: 'Getting Started', link: '/open-source/index.html' },
{ text: 'Create', link: '/open-source/usage/create.html' },
{ text: 'Insert', link: '/open-source/usage/insert.html' },
{ text: 'Remove', link: '/open-source/usage/remove.html' },
{ text: 'Update', link: '/open-source/usage/update.html' },
{ text: 'Utilities', link: '/open-source/usage/utilities.html' },
{
text: 'Search',
collapsed: true,
items: [
{ text: 'Searching with Orama', link: '/open-source/usage/search/introduction.html' },
{ text: 'Vector Search', link: '/open-source/usage/search/vector-search.html' },
{ text: 'Fields Boosting', link: '/open-source/usage/search/fields-boosting.html' },
{ text: 'Facets', link: '/open-source/usage/search/facets.html' },
{ text: 'Filters', link: '/open-source/usage/search/filters.html' },
{ text: 'GeoSearch', link: '/open-source/usage/search/geosearch.html' },
{ text: 'Sorting', link: '/open-source/usage/search/sorting.html' },
{ text: 'Grouping', link: '/open-source/usage/search/grouping.html' },
{ text: 'Threshold', link: '/open-source/usage/search/threshold.html' },
{ text: 'Preflight', link: '/open-source/usage/search/preflight.html' },
{ text: 'BM25', link: '/open-source/usage/search/bm25-algorithm.html' },
]
},
{ text: 'TypeScript', link: '/open-source/usage/typescript.html' },
]
},
{
text: 'Internals',
collapsed: true,
items: [
{ text: 'Components', link: '/open-source/internals/components.html' },
{ text: 'Utilities', link: '/open-source/internals/utilities.html' },
]
},
{
text: 'Plugins',
collapsed: true,
items: [
{ text: 'Introduction', link: '/open-source/plugins/introduction.html' },
{ text: 'Writing your own plugins', link: '/open-source/plugins/writing-your-own-plugins.html' },
{ text: 'Plugin Telemetry', link: '/open-source/plugins/plugin-telemetry.html' },
{ text: 'Plugin Astro', link: '/open-source/plugins/plugin-astro.html' },
{ text: 'Plugin Data Persistence', link: '/open-source/plugins/plugin-data-persistence.html' },
{ text: 'Plugin Docusaurus', link: '/open-source/plugins/plugin-docusaurus.html' },
{ text: 'Plugin Match Highlight', link: '/open-source/plugins/plugin-match-highlight.html' },
{ text: 'Plugin Parsedoc', link: '/open-source/plugins/plugin-parsedoc.html' },
{ text: 'Plugin Nextra', link: '/open-source/plugins/plugin-nextra.html' },
]
},
{
text: 'Text Analysis',
collapsed: true,
items: [
{ text: 'Stemming', link: '/open-source/text-analysis/stemming.html' },
{ text: 'Stopwords', link: '/open-source/text-analysis/stopwords.html' },
]
}
],
'/cloud/': [
{
text: 'Understanding Orama',
collapsed: false,
items: [
{ text: 'Introduction', link: '/cloud/understanding-orama/introduction.html' },
{ text: 'Indexes', link: '/cloud/understanding-orama/indexes.html' },
]
},
{
text: 'Working with indexes',
collapsed: true,
items: [
{ text: 'Create a new index', link: '/cloud/working-with-indexes/create-a-new-index.html' },
{ text: 'Edit an index', link: '/cloud/working-with-indexes/edit-an-index.html' },
{ text: 'Delete an index', link: '/cloud/working-with-indexes/delete-an-index.html' },
]
},
{
text: 'Data Sources',
collapsed: false,
items: [
{
text: 'Native Integrations',
collapsed: true,
items: [
{ text: 'Introduction', link: '/cloud/data-sources/native-integrations/introduction.html' },
{ text: 'Shopify', link: '/cloud/data-sources/native-integrations/shopify.html' },
{ text: 'Docusaurus', link: '/cloud/data-sources/native-integrations/docusaurus.html' },
]
},
{
text: 'Custom Integrations',
collapsed: true,
items: [
{ text: 'Introduction', link: '/cloud/data-sources/custom-integrations/introduction.html' },
{ text: 'REST API', link: '/cloud/data-sources/custom-integrations/rest-api.html' },
{ text: 'Webhook', link: '/cloud/data-sources/custom-integrations/webhooks.html' },
{ text: 'JSON File', link: '/cloud/data-sources/custom-integrations/json-file.html' },
{ text: 'CSV File', link: '/cloud/data-sources/custom-integrations/csv-file.html' },
]
}
]
},
{
text: 'Integrating Orama Cloud',
items: [
{ text: 'JavaScript SDK', link: '/cloud/integrating-orama-cloud/javascript-sdk.html' },
]
}
]
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/oramasearch/orama' },
{ icon: 'slack', link: 'https://orama.to/slack' },
{ icon: 'twitter', link: 'https://twitter.com/OramaSearch' }
],

footer: {
copyright: 'Copyright © 2023-present OramaSearch Inc.',
},
},
})
17 changes: 17 additions & 0 deletions packages/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
Loading