Improve definition readouts

This commit is contained in:
Elnu 2023-07-21 10:57:54 -07:00
parent b5b45cc4af
commit b99ebc787d
4 changed files with 22 additions and 15 deletions

View file

@ -1,3 +1,3 @@
{{ define "definition" }}
{{ if .PartOfSpeech }}<chip>{{ .PartOfSpeech }}</chip> {{ end }}{{ .Definition -}}
{{- define "definition" -}}
{{ if .PartOfSpeech }}<small><chip>{{ .PartOfSpeech }}</chip></small><br>{{ end }}{{ .Definition -}}
{{ end }}

View file

@ -1,5 +1,5 @@
<p><i>{{ $count := (len .) }}{{ if eq $count 0 }}No results{{ else }}{{ $count }} result{{ if ne $count 1}}s{{ end }}{{ end }}.</i></p>
{{- range . -}}
{{ range . -}}
<div class="box">
<h3>
{{- if .Kanji -}}
@ -13,7 +13,9 @@
{{- else -}}
<ol>
{{- range .Definitions }}
<li>{{- template "definition" . -}}</li>
<li>
{{ template "definition" . }}
</li>
{{- end }}
</ol>
{{- end }}