Skip to content

Commit 3f39f6c

Browse files
committed
search: add Algolia search to site
Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent 7de98e8 commit 3f39f6c

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

config.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ unsafe = true
2626
[params]
2727
copyright = "The TinyGo Authors"
2828

29+
# Google Custom Search Engine ID. Remove or comment out to disable search.
30+
# gcs_engine_id = "feba5f0a3db52897d"
31+
32+
# Enable Algolia DocSearch
33+
algolia_docsearch = true
2934

3035
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
3136
github_repo = "https://github.com/tinygo-org/tinygo-site"
@@ -41,7 +46,7 @@ sidebar_menu_compact = true
4146
# Set to true to disable breadcrumb navigation.
4247
breadcrumb_disable = false
4348
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
44-
sidebar_search_disable = false
49+
sidebar_search_disable = true
4550
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar
4651
navbar_logo = true
4752
# Set to true to disable the About link in the site footer

content/search.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Search Results
3+
layout: search
4+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
2+
<script type="text/javascript"> docsearch({
3+
apiKey: '42f398a5126d862b7112ee3ba7fddfb2',
4+
indexName: 'tinygo',
5+
inputSelector: '.td-search-input',
6+
debug: false // Set debug to true if you want to inspect the dropdown
7+
});
8+
</script>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />

0 commit comments

Comments
 (0)