generated from ElnuDev/go-project
Better template loading, word page
See https://stackoverflow.com/a/11468132
This commit is contained in:
parent
f558d7f0c1
commit
e70916c6c1
11 changed files with 236 additions and 87 deletions
|
@ -1,11 +1,9 @@
|
|||
{{- define "search" -}}
|
||||
<p><i>{{ if .Truncated }}Truncated results, showing first {{ .Count }}{{ else }}{{ if eq .Count 0 }}No results{{ else }}{{ .Count }} result{{ if ne .Count 1}}s{{ end }}{{ end }}{{ end }}.</i></p>
|
||||
{{ range .ExactResults -}}
|
||||
{{- template "word" . -}}
|
||||
{{- end }}
|
||||
{{ if and (ne (len .ExactResults) 0) (ne (len .OtherResults) 0) }}<hr>{{ end }}
|
||||
{{ range .OtherResults -}}
|
||||
{{ template "word" . }}
|
||||
{{- define "title" }}{{ .Query }} search - {{ template "sitetitle" . }}{{- end -}}
|
||||
|
||||
{{- define "value" }}{{ .Query }}{{- end -}}
|
||||
|
||||
{{- define "results" -}}
|
||||
{{- template "entryfull" .Entry -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- template "search" . -}}
|
||||
|
||||
{{- template "index" . -}}
|
Reference in a new issue