| <!-- |
| Copyright 2019 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. |
| --> |
| |
| {{define "main_content"}} |
| <div class="Container"> |
| <a class="GodocButton" href="{{.GodocURL}}">Back to godoc.org</a> |
| <div class="SearchResults"> |
| <h1 class="SearchResults-header">Results for “{{.Query}}”</h1> |
| <div class="SearchResults-help"><a href="/search-help">Search help</a></div> |
| <div class="SearchResults-resultCount"> |
| {{template "pagination_summary" .Pagination}} {{pluralize .Pagination.TotalCount "result"}} |
| {{template "pagination_nav" .Pagination}} |
| </div> |
| {{if eq (len .Results) 0}} |
| <div> |
| <img class="SearchResults-emptyContentGopher" src="/static/img/gopher-airplane.svg" alt="The Go Gopher"> |
| <h3 class="SearchResults-emptyContentMessage">No results found.</h3> |
| <p class="SearchResults-emptyContentMessage"> |
| {{if (.Experiments.IsActive "frontend-fetch")}} |
| If you think “{{.Query}}” is a valid package or module, you could try downloading it by visiting <a href="https://pkg.go.dev/{{.Query}}">pkg.go.dev/{{.Query}}</a>. |
| {{else}} |
| If you think “{{.Query}}” is a valid package, you could try downloading it following the <a href="/about#adding-a-package">instructions here</a>. |
| {{end}} |
| </p> |
| </div> |
| {{else}} |
| <div>{{/* Containing element is needed to use *-of-type selectors */}} |
| {{$query := .Query}} |
| {{range .Results}} |
| <div class="SearchSnippet"> |
| <h2 class="SearchSnippet-header"> |
| <a href="/{{.PackagePath}}">{{.PackagePath}}</a> |
| </h2> |
| <p class="SearchSnippet-synopsis">{{.Synopsis}}</p> |
| <div class="SearchSnippet-infoLabel"> |
| <b class="InfoLabel-title">Version:</b> {{.DisplayVersion}} |
| <span class="InfoLabel-divider">|</span> |
| <b class="InfoLabel-title">Published:</b> {{.CommitTime}} |
| <span class="InfoLabel-divider">|</span> |
| <b class="InfoLabel-title">Imported by:</b> {{.NumImportedBy}} |
| <span class="InfoLabel-divider">|</span> |
| <b class="InfoLabel-title">{{pluralize (len .Licenses) "License"}}:</b> |
| {{if .Licenses}} |
| {{commaseparate .Licenses}} |
| {{else}} |
| <span>N/A</span> |
| {{end}} |
| </div> |
| </div> |
| {{end}} |
| {{end}} |
| </div> |
| <div class="SearchResults-footer"> |
| {{template "pagination_nav" .Pagination}} |
| </div> |
| </div> |
| </div> |
| {{end}} |