You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 satır
1.9KB

  1. {{ define "title" -}}
  2. {{ .Title }} | {{ .Site.Title }}
  3. {{- end }}
  4. {{ define "header" }}
  5. {{ partial "masthead.html" . }}
  6. {{ end }}
  7. {{ define "main" }}
  8. <header>
  9. <h1>{{ .Title }}</h1>
  10. </header>
  11. <noscript>
  12. Aw-shucks! Search requires use of JavaScript to function properly.
  13. </noscript>
  14. <div id="search-app">
  15. <div v-cloak>
  16. <section>
  17. <form v-on:submit.prevent role="search" class="form" action="{{ "search" | absURL }}">
  18. <fieldset class="form-group">
  19. <input v-model="query" id="query" name="s" type="search" class="form-control" maxlength="32" autocomplete="off"{{ with .Params.form.input.placeholder }} placeholder="{{ . }}"{{ end }}{{ if eq .Params.form.input.disabled true }} disabled{{ end }}>
  20. {{ with .Params.form.helpblock }}
  21. <div class="help-block">{{ . | safeHTML }}</div>
  22. {{ end }}
  23. </fieldset>
  24. </form>
  25. </section>
  26. <section v-if="results.length">
  27. <p><i>Showing results for “{ resultsForSearch }”.</i></p>
  28. <div id="search-results">
  29. <article v-for="result in results" itemscope itemtype="https://schema.org/CreativeWork">
  30. <header itemprop="name">
  31. <h2 itemprop="name"><a :href="result.item.url"><span v-html="result.item.title"></span></a></h2>
  32. </header>
  33. <div v-html=result.item.summary itemprop="description"></div>
  34. <nav class="readmore"><p><a itemprop="url" :href="result.item.url">Read More&nbsp;&raquo;</a></p></nav>
  35. </article>
  36. </div>
  37. </section>
  38. </div>
  39. </div>
  40. {{ end }}
  41. {{ define "footer" }}
  42. {{ partial "powered-by.html" . }}
  43. {{ partial "cookie-disclaimer.html" . }}
  44. {{ $script := resources.Get "/js/search.js" | resources.ExecuteAsTemplate "search.js" . }}
  45. <script integrity="{{ printf "%s" ($script | resources.Fingerprint "sha512").Data.Integrity | safeHTML }}">
  46. {{- $script.Content | safeJS -}}
  47. </script>
  48. {{ end }}