Skip to content

Commit

Permalink
docs: vitepress init
Browse files Browse the repository at this point in the history
  • Loading branch information
amandesai01 committed Jan 17, 2024
1 parent b03bf12 commit 3f6713e
Show file tree
Hide file tree
Showing 11 changed files with 972 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ coverage
Network Trash Folder
Temporary Items
.apdisk

docs/.vitepress/dist
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![nuxt-orama](./docs/cover.png)
![nuxt-orama](./docs/public/cover.png)

# Nuxt Orama

Expand Down
31 changes: 31 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "NuxtOrama",
description: "Orama Search Module for Nuxt3",
head: [
['link', { rel: 'icon', href: '/nuxt-orama-logo.svg' }]
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Docs', link: '/getting-started' }
],
logo: { src: '/nuxt-orama-logo.svg' },
sidebar: [
{
items: [
{ text: 'Getting Started', link: '/getting-started' },
{ text: 'Configuration', link: '/configuration' },
{ text: 'Usage', link: '/usage' },
]
}
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/amandesai01/nuxt-orama' }
]
}
})
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:::info
🚧 WIP
:::
60 changes: 60 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Getting Started

## Introduction

`nuxt-orama` is a powerful Nuxt3 module designed to effortlessly integrate [OramaSearch](https://oramasearch.com) into your projects. It provides access to the Orama instance throughout your application. It is even possible to create multiple schemas (instances).

## Quick Start

### Install `nuxt-orama`

::: code-group
```sh [npm]
$ npm install nuxt-orama
```
```sh [yarn]
$ yarn add nuxt-orama
```
:::

### Enable the module in your Nuxt configuration

```Js
export default defineNuxtConfig({
modules: ['nuxt-orama'],
orama: {
schemas: [
{
schema: {
// your schema
},
id: 'unique-key-to-access-later' // defaults to `default`
}
]
}
})
```
::: tip
You can find more about configuring `nuxt-orama` [here](/configuration).
:::

### Use it in your application
```vue
<script setup lang='ts'>
const { search, searchResults } = useOramaSearch('unique-key-added-before');
const searchInput = ref('');
watchEffect(() => {
search({
term: searchInput.value
})
});
</script>
<template>
<div>
<input v-model="searchInput" type="text" />
{{ searchResults }}
</div>
</template>
```
53 changes: 53 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: NuxtOrama
text: Orama Search Module for Nuxt3
tagline: Build type-ahead search in Nuxt3 apps within minutes.
actions:
- theme: brand
text: Getting Started
link: /getting-started
- theme: alt
text: View on Github
link: https://github.com/amandesai01/nuxt-orama
image:
src: /nuxt-orama-logo.svg
alt: NuxtOrama's Logo

features:
- title: Get Started in Minutes
icon: ⚡️
details: It takes hardly a minute to configure nuxt-orama, and 5 minutes to integrate into your application.
- title: Handy Composables
icon: 💼
details: Handy composables for all functions, wrapped with refs to seamlessly integrate with your components.
- title: Manage Multiple Schemas
icon: 🪢
details: Easily manage multiple schemas and search instances throughout your application.
---


<style>
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff);

--vp-home-hero-image-background-image: linear-gradient(-45deg, #bd34fe 50%, #47caff 50%);
--vp-home-hero-image-filter: blur(44px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}
</style>
File renamed without changes
108 changes: 108 additions & 0 deletions docs/public/nuxt-orama-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Usage

:::info
🚧 WIP
:::

This module exposes composables that are auto-imported by Nuxt 3.

## `useOramaInstance()`

## `useOramaSearch()`
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch"
"test:watch": "vitest watch",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"@nuxt/kit": "^3.9.1",
"@orama/orama": "^2.0.0-beta.12"
"@orama/orama": "^2.0.0-beta.12",
"vitepress": "1.0.0-rc.31"
},
"resolutions": {
"string-width": "4.2.3"
Expand All @@ -46,4 +50,4 @@
"nuxt": "^3.9.1",
"vitest": "^1.0.0"
}
}
}
Loading

0 comments on commit 3f6713e

Please sign in to comment.