search.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{/* Partial for built-in search and Algolia search. */}}
  2. {{ if eq site.Params.search.engine 1 | or (eq site.Params.search.engine 2) }}
  3. <aside class="search-results" id="search">
  4. <div class="container">
  5. <section class="search-header">
  6. <div class="row no-gutters justify-content-between mb-3">
  7. <div class="col-6">
  8. <h1>{{ i18n "search" }}</h1>
  9. </div>
  10. <div class="col-6 col-search-close">
  11. <a class="js-search" href="#"><i class="fas fa-times-circle text-muted" aria-hidden="true"></i></a>
  12. </div>
  13. </div>
  14. <div id="search-box">
  15. {{ if eq site.Params.search.engine 1 }}
  16. <input name="q" id="search-query" placeholder="{{i18n "search_placeholder"}}" autocapitalize="off"
  17. autocomplete="off" autocorrect="off" spellcheck="false" type="search" class="form-control">
  18. {{ else }}
  19. <!-- Search box will appear here -->
  20. {{ end }}
  21. </div>
  22. {{ if eq site.Params.search.engine 1 | and site.Data.search_queries }}
  23. <div id="search-common-queries" class="pt-3">
  24. <div class="font-weight-bold pb-3">{{ i18n "search_common_queries" | default "Common searches" }}</div>
  25. <ul class="fa-ul">
  26. {{ range site.Data.search_queries }}
  27. <li class="pb-3">
  28. <a href="{{.link | relURL}}"><i class="fa-li fas fa-search" aria-hidden="true"></i><span class="pl-1">{{.query | markdownify | emojify}}</span></a>
  29. </li>
  30. {{ end }}
  31. </ul>
  32. </div>
  33. {{ end }}
  34. </section>
  35. <section class="section-search-results">
  36. <div id="search-hits">
  37. <!-- Search results will appear here -->
  38. </div>
  39. </section>
  40. </div>
  41. </aside>
  42. {{end}}