mirror of https://github.com/onweru/compose.git

weru
27.06.2023 aeaa567ce0d6abbfb0bafbcdc661c79195fa06ed
update documentation for algolia search

Signed-off-by: weru <fromweru@gmail.com>
3 files modified
35 ■■■■ changed files
exampleSite/config/_default/params.toml 4 ●●●● patch | view | raw | blame | history
exampleSite/content/docs/compose/github-actions.md 11 ●●●●● patch | view | raw | blame | history
exampleSite/content/docs/compose/search.md 20 ●●●●● patch | view | raw | blame | history
exampleSite/config/_default/params.toml
@@ -13,7 +13,7 @@
defaultLightingMode = "auto" # other possible values: "dark", "light"
# sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable.
codeMaxLines = 7
codeMaxLines = 10
# show/hide line numbers by default. Switch to `true` if you'd rather have them on.
showLineNumbers = false
@@ -28,7 +28,7 @@
on = true
# Site logo
[search.algolia]
enable = true # if false search will default to fusejs
enable = false # if false search will default to fusejs
id = "Q40WQQX84U" # Application ID
index = "compose" # Index name
key = "da87401a458102ec6bbd6cc5e5cf8d95" # Search-Only API Key
exampleSite/content/docs/compose/github-actions.md
@@ -1,22 +1,25 @@
+++
description = "Use github actions with compose theme"
title = "Leverage Github actions to publish with compose theme"
title = "Leverage Github actions"
weight = 11
+++
This theme ships with 2 github actions inside the exampleSite folder:
1. AWS CI
2. Algolia CI
## AWS CI
    This helps you to autodeploy your hugo website from github to an AWS s3 bucket. Set the secrets in the action accordingly and voila.
2. Algolia CI
## Algolia CI
    When [algolia search integration](https://github.com/onweru/compose/issues/98) is rolls out (soon), this action will automatically update your algolia search index. No extra npm manual setup will be needed.
  This action will automatically update your algolia search index. No extra npm manual setup will be needed.
These actions are customizable to fire off under your specified set of circumstances.
By default, the actions will be off, so be sure to turn them on
By default, the actions will be off, so be sure to turn them on, and set the github actions secrets appropriately.
```shell
name: Update Algolia Search Index
exampleSite/content/docs/compose/search.md
@@ -11,7 +11,25 @@
   home = ["HTML", "RSS","JSON"]
```
Compose implements `fuse.js` to enable search functionality. At the time of this writing, search on these theme takes either of this forms:
Compose implements [Fuse js](https://fusejs.io/) or [Algolia](https://www.algolia.com/doc/rest-api/search/) to enable search functionality. By default Fuse is applied. Algolia can be enabled by adding this settings to `config/_default/params.toml` file
```toml
# search
[search]
on = true
# Site logo
[search.algolia]
enable = false # if false search will default to fusejs
id = "Q40WQQX84U" # Application ID
index = "compose" # Index name
key = "da87401a458102ec6bbd6cc5e5cf8d95" # Search-Only API Key
```
Both search engines will display results using the same UI. By choosing the default (.ie fuse js),  you will be opting for local search. This way, no additional setup is needed.
Algolia will require you to build and host your index. For those using Github, this theme ships with an [algolia github action](/docs/compose/github-actions/#algolia-ci).
At the time of this writing, search on these theme takes either of this forms:
### 1. Passive search