Algolia search

This commit is contained in:
mDuo13
2020-04-21 11:01:27 -07:00
parent 36fd02dd6a
commit 2bf6fd9e54
2 changed files with 18 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ targets:
github_branch: master
strings:
blog: "Blog"
search: "Search site with Google..."
search: "Search site..."
bc_home: "Home"
tl_banner:
head: "Sorry, this page is not available in your language."
@@ -143,7 +143,7 @@ targets:
github_branch: master
strings:
blog: "ブログ"
search: "サイトをGoogleで検索"
search: "サイトを検索"
bc_home: "ホーム"
tl_banner:
head: "も仕分けありませんがこのページは日本語では入手不可" #TODO: check translation
@@ -298,7 +298,7 @@ targets:
no_cover: true
strings:
blog: "Blog"
search: "Search site with Google..."
search: "Search site..."
bc_home: "Home"
tl_banner:
head: "Sorry, this page is not available in your language."
@@ -327,7 +327,7 @@ targets:
"([\\w-]+\\.html)": https://xrpl.org/\1
strings:
blog: "Blog"
search: "Search site with Google..."
search: "Search site..."
bc_home: "Home"
tl_banner:
head: "Sorry, this page is not available in your language."

View File

@@ -40,6 +40,8 @@
);
</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
{% block head %}
{% endblock %}
@@ -70,10 +72,9 @@
</li>
</ul><!-- /.navbar-nav -->
{% include 'template-github-edit.html' %}
<form class="navbar-form navbar-right" id="navbar-search" role="search" method="get" action="https://www.google.com/search">
<form class="navbar-form navbar-right" id="navbar-search" role="search">
<div class="form-inline">
<label class="sr-only" for="topsearchbar">{{target.strings.search}}</label>
<input name="q" value="site:xrpl.org" type="hidden">
<input id="topsearchbar" name="q" type="text" class="form-control" class="top-search" placeholder="{{target.strings.search}}">
<button type="submit" class="btn btn-default fa fa-search">&nbsp;</button>
</div>
@@ -130,6 +131,17 @@
<!-- fontawesome icons -->
<link rel="stylesheet" href="assets/vendor/fontawesome/css/font-awesome.min.css" />
<!-- Algolia DocSearch -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '70de5b9b8ef95460f3c6e04054b325b2',
indexName: 'xrpl',
inputSelector: '#topsearchbar',
algoliaOptions: { 'facetFilters': ["lang:{{target.lang}}"] },
debug: false
});
</script>
{% block endbody %}{% endblock %}
</body>
</html>