{{ define "main" }}
<h1>Search</h1>
<p>Search posts by keyword.</p>

<input type="text" id="search" placeholder="Search..." />
<ul id="results"></ul>

{{ with site.Taxonomies.tags }}
<section class="tags">
  <h2>Tags</h2>
  {{ $tags := slice }}
  {{ range $name, $taxonomy := . }}
    {{ $tags = $tags | append (dict "name" $name "count" $taxonomy.Count) }}
  {{ end }}
  {{ $sorted := sort $tags "count" "desc" }}
  <div class="tag-list">
    {{ range $i, $tag := $sorted }}
      {{ if $i }}<span class="sep">·</span>{{ end }}
      <a href="{{ "tags/" | relURL }}{{ $tag.name | urlize }}">{{ $tag.name }}</a>
    {{ end }}
  </div>
</section>
{{ end }}
{{ end }}
