const item = items[id];
const result = template.cloneNode(true);
const a = result.querySelector('a');
- const time = result.querySelector('time');
- const content = result.querySelector('.content');
+ // const time = result.querySelector('time');
+ // const content = result.querySelector('.content');
a.innerHTML = item.title;
a.href = item.permalink;
- time.innerText = item.date;
- content.innerHTML = item.summary;
+ // time.innerText = item.date;
+ // content.innerHTML = item.summary;
fragment.appendChild(result);
}
results.appendChild(fragment);
--- /dev/null
+ #search-container {
+ div.search-results {
+ overflow-y: scroll;
+ }
+ }
@import 'components/tiles';
@import 'components/contact-method';
@import 'components/spotlights';
+ @import 'components/search';
// Layout.
<script defer src="{{ $contact.RelPermalink }}"></script>
{{ end -}}
-{{ if .HasShortcode "search" -}}
{{ $flexsearch := resources.Get "js/flexsearch.compact.js" | fingerprint -}}
<script defer src="{{ $flexsearch.RelPermalink }}"></script>
{{ $search_opts := dict "minify" true "params" (dict "searchLimit" (site.Params.searchLimit | default 20)) -}}
{{ $search := resources.Get "js/search.js" | js.Build $search_opts | fingerprint -}}
<script defer src="{{ $search.RelPermalink }}"></script>
-{{ end -}}
</li>
{{ end }}
{{ end }}
+ <li>{{- partial "search.html" . -}}</li>
</ul>
</nav>
--- /dev/null
+<div id="search-container">
+ <p class="error message js-hidden">JavaScript is required for this form to work</p>
+ <p class="search-loading status message hidden">Loading Search Results</p>
+
+ <div class="search-input hidden">
+ <form id="search-form" class="search-form" action="#" method="post" accept-charset="UTF-8" role="search">
+ <label for="query" >Search this site</label>
+ <input type="search" id="query" name="query" class="search-text" placeholder="Search this site..." maxlength="128">
+ <input type="submit" name="submit" class="form-submit hidden" value="Search" />
+ </form>
+ </div>
+
+ <div class="search-results"></div>
+
+ <template>
+ <article class="search-result list-view">
+ <header>
+ <h3 class="title title-submitted"><a href="#">Title here</a></h3>
+ </header>
+ </article>
+ </template>
+</div>