feat(docs): add docsearch plugin
This commit is contained in:
@@ -8,7 +8,7 @@ const breakpoints = useBreakpoints(breakpointsTailwind)
|
|||||||
|
|
||||||
const { dimensions, instance, onPaneReady, getNodes, getNode } = useVueFlow({
|
const { dimensions, instance, onPaneReady, getNodes, getNode } = useVueFlow({
|
||||||
nodes: [
|
nodes: [
|
||||||
{ id: 'intro', type: 'box', position: { x: 0, y: 0 }, draggable: true },
|
{ id: 'intro', type: 'box', position: { x: 0, y: 0 } },
|
||||||
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } },
|
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } },
|
||||||
{ id: 'documentation', type: 'box', position: { x: 300, y: 400 } },
|
{ id: 'documentation', type: 'box', position: { x: 300, y: 400 } },
|
||||||
],
|
],
|
||||||
@@ -38,7 +38,7 @@ const { dimensions, instance, onPaneReady, getNodes, getNode } = useVueFlow({
|
|||||||
zoomOnScroll: false,
|
zoomOnScroll: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
onPaneReady(async ({ fitView }) => {
|
onPaneReady(({ fitView }) => {
|
||||||
fitView({
|
fitView({
|
||||||
nodes: ['intro', 'examples', 'documentation'],
|
nodes: ['intro', 'examples', 'documentation'],
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
@@ -59,7 +59,7 @@ onPaneReady(async ({ fitView }) => {
|
|||||||
<template #node-box="props">
|
<template #node-box="props">
|
||||||
<template v-if="props.id === 'intro'">
|
<template v-if="props.id === 'intro'">
|
||||||
<div class="max-w-[500px]">
|
<div class="max-w-[500px]">
|
||||||
<BoxNode class="bg-green-500 text-white">
|
<BoxNode class="intro">
|
||||||
<div class="font-mono flex flex-col gap-4 p-4 items-center">
|
<div class="font-mono flex flex-col gap-4 p-4 items-center">
|
||||||
<h1 class="pointer-events-none text-2xl lg:text-4xl text-center">Visualize your ideas with Vue Flow</h1>
|
<h1 class="pointer-events-none text-2xl lg:text-4xl text-center">Visualize your ideas with Vue Flow</h1>
|
||||||
<h2 class="pointer-events-none text-lg lg:text-xl font-normal">
|
<h2 class="pointer-events-none text-lg lg:text-xl font-normal">
|
||||||
@@ -88,6 +88,16 @@ onPaneReady(async ({ fitView }) => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.intro {
|
||||||
|
@apply cursor-pointer
|
||||||
|
bg-green-500
|
||||||
|
text-white
|
||||||
|
transform
|
||||||
|
transition-transform
|
||||||
|
duration-300
|
||||||
|
hover:(scale-105 ring ring-white);
|
||||||
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
@apply flex
|
@apply flex
|
||||||
gap-3
|
gap-3
|
||||||
@@ -97,11 +107,10 @@ onPaneReady(async ({ fitView }) => {
|
|||||||
transform
|
transform
|
||||||
transition-transform
|
transition-transform
|
||||||
duration-300
|
duration-300
|
||||||
hover:scale-102
|
hover:(scale-102 bg-black dark:(bg-white text-black))
|
||||||
transition-colors
|
transition-colors
|
||||||
ease-in-out
|
ease-in-out
|
||||||
rounded-lg
|
rounded-lg
|
||||||
hover:bg-black
|
|
||||||
text-white
|
text-white
|
||||||
font-semibold
|
font-semibold
|
||||||
text-lg;
|
text-lg;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default defineUserConfig<DefaultThemeOptions>({
|
|||||||
viteOptions: {
|
viteOptions: {
|
||||||
plugins: [
|
plugins: [
|
||||||
WindiCSS({
|
WindiCSS({
|
||||||
config: resolve(__dirname, './windi.config.ts')
|
config: resolve(__dirname, './windi.config.ts'),
|
||||||
}),
|
}),
|
||||||
Components({
|
Components({
|
||||||
dirs: [resolve(__dirname, '../../components')],
|
dirs: [resolve(__dirname, '../../components')],
|
||||||
@@ -31,9 +31,19 @@ export default defineUserConfig<DefaultThemeOptions>({
|
|||||||
}),
|
}),
|
||||||
Icons(),
|
Icons(),
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
'@vuepress/docsearch',
|
||||||
|
{
|
||||||
|
apiKey: process.env.ALGOLIA_API_KEY,
|
||||||
|
indexName: 'YCY25RSLA8',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
theme: resolve(__dirname, './theme/index.ts'),
|
theme: resolve(__dirname, './theme/index.ts'),
|
||||||
|
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
|
|||||||
Reference in New Issue
Block a user