algolia.js 664 B

12345678910111213141516171819202122
  1. (function() {
  2. var doc_version = document.querySelector('meta[name="doc_version"]').getAttribute('content');
  3. // Initialize the Algolia search widget
  4. docsearch({
  5. apiKey: 'c39cb614363a2a156811478bc2d0573b',
  6. indexName: 'godotengine',
  7. inputSelector: '#rtd-search-form input[type=text]',
  8. algoliaOptions: {
  9. facetFilters: ["version:" + (doc_version || 'stable')]
  10. },
  11. });
  12. window.addEventListener('keydown', function(event) {
  13. if (event.key === '/') {
  14. document.querySelector('#rtd-search-form input[type=text]').focus();
  15. event.preventDefault();
  16. }
  17. })
  18. })();