generated from ElnuDev/go-project
parent
b99ebc787d
commit
fb045b9276
@ -1,23 +1,8 @@
|
||||
<p><i>{{ $count := (len .) }}{{ if eq $count 0 }}No results{{ else }}{{ $count }} result{{ if ne $count 1}}s{{ end }}{{ end }}.</i></p>
|
||||
{{ range . -}}
|
||||
<div class="box">
|
||||
<h3>
|
||||
{{- if .Kanji -}}
|
||||
<ruby>{{- .Kanji -}}<rp>(</rp><rt>{{- .Reading -}}</rt><rp>)</rp></ruby>
|
||||
{{- else -}}
|
||||
{{- .Reading -}}
|
||||
{{- end -}}
|
||||
</h3>
|
||||
{{ if le (len .Definitions) 2 -}}
|
||||
<p>{{- template "definition" (index .Definitions 0) -}}</p>
|
||||
{{- else -}}
|
||||
<ol>
|
||||
{{- range .Definitions }}
|
||||
<li>
|
||||
{{ template "definition" . }}
|
||||
</li>
|
||||
{{- end }}
|
||||
</ol>
|
||||
<p><i>{{ if eq .Count 0 }}No results{{ else }}{{ .Count }} result{{ if ne .Count 1}}s{{ end }}{{ end }}.</i></p>
|
||||
{{- range .ExactResults -}}
|
||||
{{- template "word" . -}}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ end -}}
|
||||
<hr>
|
||||
{{ range .OtherResults -}}
|
||||
{{ template "word" . }}
|
||||
{{- end -}}
|
@ -0,0 +1,22 @@
|
||||
{{ define "word" }}
|
||||
<div class="box">
|
||||
<h3>
|
||||
{{- if .Kanji -}}
|
||||
<ruby>{{- .Kanji -}}<rp>(</rp><rt>{{- .Reading -}}</rt><rp>)</rp></ruby>
|
||||
{{- else -}}
|
||||
{{- .Reading -}}
|
||||
{{- end -}}
|
||||
</h3>
|
||||
{{ if le (len .Definitions) 2 -}}
|
||||
<p>{{- template "definition" (index .Definitions 0) -}}</p>
|
||||
{{- else -}}
|
||||
<ol>
|
||||
{{- range .Definitions }}
|
||||
<li>
|
||||
{{ template "definition" . }}
|
||||
</li>
|
||||
{{- end }}
|
||||
</ol>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ end }}
|
Reference in new issue