content: display number of importers in search results
Search results now show the number of packages that a given result is
imported by.
Updates b/130797141
<h2><a href="/{{.PackagePath}}?v={{.Version}}" class="SearchSnippetContent-packageName">{{ .PackagePath }}</a></h2>
<p><i>{{ .Version }}</i></p>
<p>{{ .Synopsis }}</p>
- <p class="SearchSnippetContent-commitTime">Published {{ .CommitTime }}</p>
+ <p class="SearchSnippetContent-commitTime">
+ <span>Published {{ .CommitTime }}</span>
+ {{ if gt .NumImporters 1 }}
+ <span> | Imported by {{ .NumImporters}} packages</span>
+ {{ else if eq .NumImporters 1 }}
+ <span> | Imported by {{ .NumImporters}} package</span>
+ {{ end }}
+ </p>
<hr>
</div>
{{ end}}
