Format challenge #87
This commit is contained in:
parent
5d018c79cd
commit
a9993b0850
2 changed files with 122 additions and 2 deletions
|
@ -47,13 +47,16 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if .dictionary -}}
|
||||
{{ if .dictionary }}
|
||||
{{- $.Scratch.Set "dictionary" .dictionary -}}
|
||||
{{ end }}
|
||||
{{- if not (and .dictionary (hasPrefix .dictionary "http")) -}}
|
||||
{{- $.Scratch.Set "dictionary" (printf "%s" ($.Scratch.Get "dictionary") | printf "%s%s" "https://jisho.org/word/" | printf "%s") -}}
|
||||
{{- end -}}
|
||||
{{- if and (not .dictionary) (not .pos) -}}
|
||||
{{- $.Scratch.Get "html" | safeHTML -}}
|
||||
{{- else -}}
|
||||
<a href="https://jisho.org/word/{{- $.Scratch.Get "dictionary" -}}" class="{{- .pos -}}" title="{{- .pos -}}" target="_blank">{{- $.Scratch.Get "html" | safeHTML -}}</a>
|
||||
<a href="{{- $.Scratch.Get "dictionary" -}}" class="{{- .pos -}}" title="{{- .pos -}}" target="_blank">{{- $.Scratch.Get "html" | safeHTML -}}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}</p>
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue