fix(check): fix some html check bugs

This commit is contained in:
Dillon
2020-02-18 16:22:24 +08:00
parent d8681cd489
commit 4b3addf634
20 changed files with 53 additions and 67 deletions

View File

@@ -1,4 +1,5 @@
{{- $_hugo_config := `{ "version": 1 }` -}}
{{- $inner := .Inner | .Page.RenderString -}}
{{- $iconMap := dict "note" "fas fa-pencil-alt" -}}
{{- $iconMap = dict "abstract" "fas fa-list-ul" | merge $iconMap -}}
{{- $iconMap = dict "info" "fas fa-info-circle" | merge $iconMap -}}
@@ -22,14 +23,14 @@
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
</summary>
{{- end -}}
{{- .Inner -}}
{{- $inner -}}
</details>
{{- else -}}
<div class="admonition {{ $type }}">
{{- with .Get "title" -}}
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
{{- end -}}
{{- .Inner -}}
{{- $inner -}}
</div>
{{- end -}}
{{- else -}}
@@ -41,14 +42,14 @@
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
</summary>
{{- end -}}
{{- .Inner -}}
{{- $inner -}}
</details>
{{- else -}}
<div class="admonition {{ $type }}">
{{- with .Get 1 -}}
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
{{- end -}}
{{- .Inner -}}
{{- $inner -}}
</div>
{{- end -}}
{{- end -}}