This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.svx
53 lines (38 loc) · 1.65 KB
/
index.svx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<script>
import Toc from 'svelte-toc'
import Example from '../components/Example.svelte'
import GitHubCorner from '../components/GitHubCorner.svelte'
import SearchIcon from '../lib/SearchIcon.svelte'
import Docs from '../docs.svx'
</script>
<Toc headingSelector={[...Array(5).keys()].map((i) => `main h${i + 2}`)} --toc-mobile-bg-color="black" --toc-mobile-btn-color="white" --toc-desktop-margin="11em 0 0 0" />
<GitHubCorner href="https://github.com/janosh/svelte-algolia" --ghc-color="var(--body-bg)" --ghc-bg="white" />
<main>
# ![Logo](/favicon.svg) Svelte-Algolia
[![Test Status](https://github.com/janosh/svelte-algolia/workflows/Tests/badge.svg)](https://github.com/janosh/svelte-algolia/actions)
[![NPM version](https://img.shields.io/npm/v/svelte-algolia?color=blue&logo=NPM)](https://npmjs.com/package/svelte-algolia)
[![Netlify Status](https://api.netlify.com/api/v1/badges/496f6094-b6b2-4929-ab16-ba2fdc61d57e/deploy-status)](https://app.netlify.com/sites/svelte-algolia/deploys)
Utility for server-side Algolia index updates plus a client-side search component for Svelte apps. Only adds a single dependency ([`algoliasearch`](https://npmjs.com/package/algoliasearch)) to client and server.
## Live Demo
This is what Svelte-Algolia integrated into a nav bar might look like. Click the <SearchIcon /> icon to try it out!
<Example />
<br />
<Docs />
</main>
<style>
h1 {
font-size: calc(1em + 3vw);
}
h1 > a {
display: none;
}
h1 img {
height: 1.2em;
vertical-align: -10pt;
padding-right: 4pt;
}
/* tells svelte-toc how to highlight clicked headings */
:global(.toc-clicked) {
color: cornflowerblue;
}
</style>