mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add stork vanilla component
This commit is contained in:
parent
8d0264f3af
commit
c9b9bd58e8
1 changed files with 46 additions and 0 deletions
46
src/components/stork-vanilla.astro
Normal file
46
src/components/stork-vanilla.astro
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
// Stork Vanilla search
|
||||
// Stork Eleventy Example - https://github.com/stork-search/netlify-11ty-example
|
||||
|
||||
import {
|
||||
storkVersion,
|
||||
// storkExecutableName,
|
||||
// storkExecutablePath,
|
||||
// storkTomlPath,
|
||||
// storkIndexPath
|
||||
} from '~/helpers/stork/config.js'
|
||||
|
||||
// const {
|
||||
// listing
|
||||
// } = Astro.props
|
||||
|
||||
const storkStylesheetURL = `https://files.stork-search.net/releases/v${ storkVersion }/basic.css`
|
||||
const storkScriptURL = `https://files.stork-search.net/releases/v${ storkVersion }/stork.js`
|
||||
|
||||
---
|
||||
<h1>Search</h1>
|
||||
<link rel="stylesheet" href={ storkStylesheetURL } />
|
||||
|
||||
<div class="stork-wrapper">
|
||||
<input data-stork="index" class="stork-input" />
|
||||
<div data-stork="index-output" class="stork-output"></div>
|
||||
</div>
|
||||
|
||||
<script is:inline src={ storkScriptURL }></script>
|
||||
|
||||
<script>
|
||||
import { StorkClient } from '~/helpers/stork/browser.js'
|
||||
|
||||
const stork = new StorkClient({
|
||||
name: 'index',
|
||||
url: '/search-index.st',
|
||||
// config: {}
|
||||
|
||||
stork: window.stork
|
||||
})
|
||||
|
||||
const queryResult = await stork.lazyQuery( 'spo' )
|
||||
|
||||
console.log('queryResult', queryResult)
|
||||
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue