Add google search widget to rclone.org

This commit is contained in:
Ivan Andreev 2021-06-15 23:32:45 +03:00 committed by Nick Craig-Wood
parent 721bae11c3
commit 1cc6dd349e
3 changed files with 10 additions and 0 deletions

View File

@ -57,5 +57,6 @@
<script src="/js/popper.min.1.16.0.js"></script>
<script src="/js/bootstrap.min.4.4.1.js"></script>
<script src="/js/custom.js?r={{ .Date.Unix }}"></script>
<script src="/js/search.js?r={{ .Date.Unix }}"></script>
</body>
</html>

View File

@ -113,5 +113,10 @@
<a class="nav-link" href="/donate/"><i class="fa fa-heart heart"></i> Donate</a>
</li>
</ul>
<form class="form-inline" name="search_form" action="https://google.com/search" target="_blank" onsubmit="on_search();">
<input name="words" value="" type="search" placeholder="search..." class="form-control form-control-sm">
<input name="q" value="" type="hidden">
<input name="as_sitesearch" value="https://rclone.org/" type="hidden">
</form>
</div>
</nav>

4
docs/static/js/search.js vendored Normal file
View File

@ -0,0 +1,4 @@
function on_search() {
document.search_form.q.value = document.search_form.words.value + " -site:forum.rclone.org";
return true;
}