dict: MVP

This commit is contained in:
Elnu 2023-07-20 19:31:26 -07:00
parent f8ccf62570
commit 01204ffc81
9 changed files with 191 additions and 4 deletions

View file

@ -0,0 +1,21 @@
<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>{{- index .Definitions 0 -}}</p>
{{- else -}}
<ol>
{{- range .Definitions }}
<li>{{- . -}}</li>
{{- end }}
</ol>
{{- end }}
</div>
{{ end -}}