aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_help_html.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-05-30 17:32:38 -0700
committerGitHub <noreply@github.com>2023-05-30 17:32:38 -0700
commit3913ebbfcde7d327dd6f1d85e30ce114a9e8193e (patch)
tree0b417c4f82bbd9ec4b62af5d0836616986daf579 /scripts/gen_help_html.lua
parent7e3ff8afa435607c703706a99cf9006893bdb399 (diff)
downloadrneovim-3913ebbfcde7d327dd6f1d85e30ce114a9e8193e.tar.gz
rneovim-3913ebbfcde7d327dd6f1d85e30ce114a9e8193e.tar.bz2
rneovim-3913ebbfcde7d327dd6f1d85e30ce114a9e8193e.zip
docs(html): algolia docsearch #23839
Need to manually include this in the generated docs html because it doesn't use the website's (jekyll) layout template. Maintenance notes: https://github.com/neovim/neovim.github.io/#maintenance Related: https://github.com/neovim/neovim.github.io/commit/ce9aef12eb1c98135965e3a9c5c792bf9e506a76
Diffstat (limited to 'scripts/gen_help_html.lua')
-rw-r--r--scripts/gen_help_html.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 1bddd3aa8b..96289c45ec 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -696,6 +696,11 @@ local function gen_one(fname, to_fname, old, commit)
<link href="/css/main.css" rel="stylesheet">
<link href="help.css" rel="stylesheet">
<link href="/highlight/styles/neovim.min.css" rel="stylesheet">
+
+ <!-- algolia docsearch https://docsearch.algolia.com/docs/docsearch-v3/ -->
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
+ <link rel="preconnect" href="https://X185E15FPG-dsn.algolia.net" crossorigin />
+
<script src="/highlight/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<title>%s - Neovim docs</title>
@@ -766,12 +771,13 @@ local function gen_one(fname, to_fname, old, commit)
main = ([[
<header class="container">
<nav class="navbar navbar-expand-lg">
- <div>
+ <div class="container-fluid">
<a href="/" class="navbar-brand" aria-label="logo">
<!--TODO: use <img src="….svg"> here instead. Need one that has green lettering instead of gray. -->
%s
<!--<img src="https://neovim.io/logos/neovim-logo.svg" width="173" height="50" alt="Neovim" />-->
</a>
+ <div id="docsearch"></div> <!-- algolia docsearch https://docsearch.algolia.com/docs/docsearch-v3/ -->
</div>
</nav>
</header>
@@ -825,6 +831,18 @@ local function gen_one(fname, to_fname, old, commit)
parse_errors: %d %s | <span title="%s">noise_lines: %d</span>
</div>
<div>
+
+ <!-- algolia docsearch https://docsearch.algolia.com/docs/docsearch-v3/ -->
+ <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
+ <script type="module">
+ docsearch({
+ container: '#docsearch',
+ appId: 'X185E15FPG',
+ apiKey: 'b5e6b2f9c636b2b471303205e59832ed',
+ indexName: 'nvim',
+ });
+ </script>
+
</footer>
]]):format(
os.date('%Y-%m-%d %H:%M'), commit, commit:sub(1, 7), #stats.parse_errors, bug_link,