Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[offline search configuration] Specify attributes for offline search belongs to the params key #996

Merged
merged 7 commits into from
May 30, 2022
24 changes: 15 additions & 9 deletions userguide/content/en/docs/Adding content/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The menu is ordered from left to right by page `weight`. So, for example, a sect

If you want to add a link to an external site to this menu, add it in `config.toml`, specifying the `weight`.

```yaml
```toml
[[menu.main]]
name = "GitHub"
weight = 50
Expand All @@ -38,7 +38,7 @@ If you want to add a link to an external site to this menu, add it in `config.to

As described in the [Hugo docs](https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu), you can add icons to the top-level menu by using the pre and/or post parameter for main menu items defined in your site's `config.toml` or via page front matter. For example, the following configuration adds the GitHub icon to the GitHub menu item, and a **New!** alert to indicate that this is a new addition to the menu.

```yaml
```toml
[[menu.main]]
name = "GitHub"
weight = 50
Expand Down Expand Up @@ -143,7 +143,8 @@ Be aware that if you accidentally enable more than one search option in your `co

By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `config.toml`:

```
```toml
[params.ui]
sidebar_search_disable = true
```

Expand All @@ -169,7 +170,7 @@ Once you have your search engine set up, you can add the feature to your site:

1. Ensure you have a Markdown file in `content/en/search.md` (and one per other languages if needed) to display your search results. It only needs a title and `layout: search`, as in the following example:

```
```yaml
---
title: Search Results
layout: search
Expand All @@ -178,7 +179,8 @@ Once you have your search engine set up, you can add the feature to your site:

1. Add your Google Custom Search Engine ID to the site params in `config.toml`. You can add different values per language if needed.

```
```toml
[params]
# Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "011737558837375720776:fsdu1nryfng"
```
Expand All @@ -205,7 +207,8 @@ If you are accepted to the program, you will receive the code to add to your doc

1. Enable Algolia DocSearch in `config.toml`.

```
```toml
[params]
# Enable Algolia DocSearch
algolia_docsearch = true
```
Expand Down Expand Up @@ -247,7 +250,8 @@ To add Lunr search to your Docsy site:

1. Enable local search in `config.toml`.

```
```toml
[params]
# Enable local search
offlineSearch = true
```
Expand All @@ -264,7 +268,8 @@ If you're [testing this locally](/docs/deployment/#serving-your-site-locally) us

You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`.

```
```toml
[params]
#Enable offline search with Lunr.js
offlineSearch = true
offlineSearchSummaryLength = 200
Expand All @@ -274,7 +279,8 @@ offlineSearchSummaryLength = 200

You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`.

```
```toml
[params]
#Enable offline search with Lunr.js
offlineSearch = true
offlineSearchMaxResults = 25
Expand Down