algolia.html 662 B

123456789101112131415161718192021
  1. {% if page.version %}
  2. {% assign version = page.version %}
  3. {% else %}
  4. {% assign version = site.latest_docs_version %}
  5. {% endif %}
  6. {% if page.language %}
  7. {% assign language = page.language %}
  8. {% else %}
  9. {% assign language = site.language %}
  10. {% endif %}
  11. <script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
  12. <script type="text/javascript">
  13. docsearch({
  14. apiKey: '{{ site.algolia_api_key }}',
  15. indexName: 'cordova',
  16. inputSelector: '#header-search-field',
  17. algoliaOptions: { 'facetFilters': ["version: {{ version }}", "language: {{ language }}"] }
  18. });
  19. </script>