feature: implement basic search

This commit is contained in:
ZanzyTHEbar 2023-01-12 22:56:49 +00:00
parent ca51db70f8
commit 679f0bc0aa
8 changed files with 135 additions and 25 deletions

View File

@ -1,11 +1,11 @@
{
"hash": "6f388531",
"browserHash": "48962f0e",
"hash": "2ab6b490",
"browserHash": "11b394ce",
"optimized": {
"vue": {
"src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "a6dbb0ab",
"fileHash": "1addd54c",
"needsInterop": false
}
},

View File

@ -3,7 +3,7 @@ import { defineConfig } from 'vitepress'
import { theme } from '../src/custom/theme'
export default defineConfig({
outDir: '../dist',
outDir: './.vitepress/out',
srcDir: './src/pages',
cleanUrls: 'with-subfolders',
/* head: [
@ -19,6 +19,6 @@ export default defineConfig({
},
lastUpdated: true,
title: 'EyeTrackVR Docs',
description: 'An awesome docs template built by me',
description: 'The official documentation for EyeTrackVR',
themeConfig: theme,
})

View File

@ -5,19 +5,20 @@
const theme = {
logo: {
src: '/logo.svg',
alt: 'EyeTrackVR Logo',
light: '/logo.svg', dark: '/logo.svg', alt: 'EyeTrackVR Logo'
},
siteTitle: 'EyeTrackVR Docs',
/* Note the footer will not show when sidebar is active */
footer: {
message: "Released under the MIT License.",
copyright: "Copyright © 2022-present ETVR",
},
searchPlaceholder: "Search...",
nav: [
{ text: "About", link: "/about" },
{ text: "Contact", link: "/contact" },
{ text: "Guide", link: "/guide" },
{ text: "Configs", link: "/configs" },
{ text: "Changelog", link: "https://github.com/..." },
{
text: 'Dropdown Menu',
items: [
@ -55,14 +56,7 @@ const theme = {
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/RedHawk989/EyeTrackVR' },
{ icon: 'discord', link: 'https://discord.gg/kkXYbVykZX' },
// You can also add custom icons by passing SVG as string:
/* {
icon: {
svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Dribbble</title><path d="M12...6.38z"/></svg>'
},
link: '...'
} */
{ icon: 'discord', link: 'https://discord.gg/kkXYbVykZX' }
]
}

View File

@ -0,0 +1,10 @@
<div align="center" class="rounded-md">
<h1 class="text-[#ab5ac7]">Contact Us</h1>
<br>
Please join our Discord for updates and any questions.
<br>
<br>
<iframe class="rounded-md" id="discord-widget" src="https://discord.com/widget?id=946212245187199026&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts" target="_blank"></iframe>
</div>
<!-- [![Discord](https://discord.com/api/guilds/946212245187199026/widget.png?style=banner3)](https://discord.gg/kkXYbVykZX){:target="_blank" :alt="Discord"} -->

View File

@ -0,0 +1,15 @@
//vite.config.ts
import { SearchPlugin } from "vitepress-plugin-search";
import { defineConfig } from "vite";
//default options
var options = {
/* ...flexSearchIndexOptions, */
previewLength: 62,
buttonLabel: "Search",
placeholder: "Search docs",
};
export default defineConfig({
plugins: [SearchPlugin(options)],
});

View File

@ -13,6 +13,9 @@
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
--font-accent: #ab5ac7;
--font-accent-light: #ab5ac7e3;
/* Code Snippet font */
--vp-font-family-mono: "Space Mono", Menlo, Monaco, Consolas, "Courier New",
monospace;
@ -33,9 +36,9 @@
--vp-c-sponsor: #fd1d7c; */
--vp-c-brand: #ab5ac7;
--vp-c-brand-light: #ab5ac7e3;
--vp-c-brand-lighter: #ab5ac7;
--vp-c-brand: var(--font-accent);
--vp-c-brand-light: var(--font-accent-ligt);
--vp-c-brand-lighter: var(--font-accent);
--vp-c-brand-lighter: rgba(31, 23, 255, 0.25);
--vp-c-brand-dark: #4d45a8;
--vp-c-brand-darker: #3a3381;

View File

@ -13,10 +13,14 @@
"serve": "vitepress serve docs"
},
"devDependencies": {
"vitepress": "^1.0.0-alpha.35",
"vue": "^3.2.45",
"flexsearch": "^0.7.31",
"markdown-it": "^13.0.1",
"postcss": "^8.2",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^7.7.2",
"tailwindcss": "^3.1.5"
"tailwindcss": "^3.1.5",
"vitepress": "^1.0.0-alpha.35",
"vitepress-plugin-search": "^1.0.4-alpha.17",
"vue": "^3.2.45"
}
}

View File

@ -390,6 +390,29 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@types/flexsearch@^0.7.3":
version "0.7.3"
resolved "https://registry.yarnpkg.com/@types/flexsearch/-/flexsearch-0.7.3.tgz#ee79b1618035c82284278e05652e91116765b634"
integrity sha512-HXwADeHEP4exXkCIwy2n1+i0f1ilP1ETQOH5KDOugjkTFZPntWo0Gr8stZOaebkxsdx+k0X/K6obU/+it07ocg==
"@types/linkify-it@*":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9"
integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==
"@types/markdown-it@^12.2.3":
version "12.2.3"
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51"
integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==
dependencies:
"@types/linkify-it" "*"
"@types/mdurl" "*"
"@types/mdurl@*":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9"
integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==
"@types/web-bluetooth@^0.0.16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz#1d12873a8e49567371f2a75fe3e7f7edca6662d8"
@ -569,6 +592,11 @@ arg@^5.0.2:
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"
integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
autoprefixer@^10.4.13:
version "10.4.13"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.13.tgz#b5136b59930209a321e9fa3dca2e7c4d223e83a8"
@ -701,6 +729,11 @@ electron-to-chromium@^1.4.251:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592"
integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==
entities@~3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4"
integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==
esbuild@^0.16.3:
version "0.16.14"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.16.14.tgz#366249a0a0fd431d3ab706195721ef1014198919"
@ -764,6 +797,11 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"
flexsearch@^0.7.31:
version "0.7.31"
resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.7.31.tgz#065d4110b95083110b9b6c762a71a77cc52e4702"
integrity sha512-XGozTsMPYkm+6b5QL3Z9wQcJjNYxp0CYn3U1gO7dwD6PAqU1SVWZxI9CCg3z+ml3YfqdPnrBehaBrnH2AGKbNA==
fraction.js@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950"
@ -841,6 +879,13 @@ lilconfig@^2.0.5, lilconfig@^2.0.6:
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4"
integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==
linkify-it@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec"
integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==
dependencies:
uc.micro "^1.0.1"
magic-string@^0.25.7:
version "0.25.9"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c"
@ -848,6 +893,22 @@ magic-string@^0.25.7:
dependencies:
sourcemap-codec "^1.4.8"
markdown-it@^13.0.1:
version "13.0.1"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430"
integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==
dependencies:
argparse "^2.0.1"
entities "~3.0.1"
linkify-it "^4.0.1"
mdurl "^1.0.1"
uc.micro "^1.0.5"
mdurl@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==
merge2@^1.3.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
@ -1207,6 +1268,15 @@ postcss@^8.1.10, postcss@^8.4.18, postcss@^8.4.20:
picocolors "^1.0.0"
source-map-js "^1.0.2"
postcss@^8.2:
version "8.4.21"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4"
integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==
dependencies:
nanoid "^3.3.4"
picocolors "^1.0.0"
source-map-js "^1.0.2"
preact@^10.0.0:
version "10.11.3"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.11.3.tgz#8a7e4ba19d3992c488b0785afcc0f8aa13c78d19"
@ -1329,6 +1399,11 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==
update-browserslist-db@^1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3"
@ -1354,6 +1429,15 @@ vite@^4.0.4:
optionalDependencies:
fsevents "~2.3.2"
vitepress-plugin-search@^1.0.4-alpha.17:
version "1.0.4-alpha.17"
resolved "https://registry.yarnpkg.com/vitepress-plugin-search/-/vitepress-plugin-search-1.0.4-alpha.17.tgz#fff6c2d17b5092d79c390487516b839a17047d58"
integrity sha512-yxZxfNK51n5xiStjr3aSxsTTUqrm9JmYHuwq59bMrGxNyEyigrFtNybmhHQokVrcxDblokKX9f96sSQmz3PypQ==
dependencies:
"@types/flexsearch" "^0.7.3"
"@types/markdown-it" "^12.2.3"
markdown-it "^13.0.1"
vitepress@^1.0.0-alpha.35:
version "1.0.0-alpha.35"
resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.0.0-alpha.35.tgz#5a92f0da5e68b6da2780b4350e216f9b0070bb59"