add algolia search
This commit is contained in:
12
docs/src/index.html
Normal file
12
docs/src/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html ${htmlAttrs}>
|
||||
<head>
|
||||
${head}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
|
||||
</head>
|
||||
<body ${bodyAttrs}>
|
||||
${app}
|
||||
${scripts}
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ $static.metadata.siteName }}
|
||||
</g-link>
|
||||
<div>
|
||||
Search |
|
||||
<input class="search" type="search" placeholder="Search" />
|
||||
<a href="https://github.com/sponsors/ueberdosis">
|
||||
Sponsor
|
||||
</a>
|
||||
@@ -109,7 +109,22 @@ export default {
|
||||
|
||||
return `https://github.com/ueberdosis/tiptap-next/blob/main/${path}`
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
initSearch() {
|
||||
docsearch({
|
||||
apiKey: '1abe7fb0f0dac150d0e963d2eda930fe',
|
||||
indexName: 'ueberdosis_tiptap',
|
||||
inputSelector: '.search',
|
||||
debug: false,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.initSearch()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user