Improve the search results view

This commit is contained in:
James Mills
2021-02-02 23:34:18 +10:00
parent 867b7b141d
commit 4c02ee5afc
5 changed files with 20 additions and 392 deletions

View File

@@ -8,18 +8,19 @@
</button>
</form>
</div>
<article class="container">
<div class="container">
<p>Found {{ $.Matches }} matches in {{ $.Duration }}</p>
{{ with $.Results }}
<ol>
{{ range . }}
<li><a href="{{ .URL }}">{{ .Title }}</a>
<p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p>
<p class="small"><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache?id={{ .ID }}">View cached</a></p>
{{ end }}
</ol>
<p>If your page appears here and you do not want it to, please contact <a href="/support">Support</a>.</p>
{{ range . }}
<article>
<h3><a href="{{ .URL }}">{{ .Title }}</a></h3>
<p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p>
<footer><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache/{{ .ID }}">View cached</a></footer>
</article>
{{ else }}
<p>No search results</p>
{{ end }}
</article>
{{ end }}
<small>If your page appears here and you do not want it to, please contact <a href="/support">Support</a></small>
</div>
{{end}}