Skip to content

Commit

Permalink
Add offlineSearchMaxResults to config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed May 23, 2020
1 parent 3c17f0f commit 4e0c7e8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/offline-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
});
});
})
.slice(0, 10);
.slice(0, $targetSearchInput.data('offlnie-search-max-results'));

//
// Make result html
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/search-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
*/}}
data-offline-search-index-json-src="{{ $offlineSearchIndexFingerprint.RelPermalink }}"
data-offline-search-base-href="/"
data-offlnie-search-max-results="{{ .Site.Params.offlineSearchMaxResults | default 10 }}"
>
{{ end }}
1 change: 1 addition & 0 deletions userguide/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ algolia_docsearch = false
#Enable offline search with Lunr.js
offlineSearch = false
offlineSearchSummaryLength = 70
offlineSearchMaxResults = 10

# User interface configuration
[params.ui]
Expand Down
10 changes: 10 additions & 0 deletions userguide/content/en/docs/Adding content/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@ offlineSearch = true
offlineSearchSummaryLength = 200
```

### Changing the maximum result count of the local search

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

```
#Enable offline search with Lunr.js
offlineSearch = true
offlineSearchMaxResults = 25
```

### Changing the width of the local search results popover

The width of the search results popover will automatically widen according to the content.
Expand Down

0 comments on commit 4e0c7e8

Please sign in to comment.