mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-12-04 14:05:01 +01:00
55 lines
2.6 KiB
HTML
55 lines
2.6 KiB
HTML
{{- $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 -}}
|
|
{{- $iconMap = dict "tip" "fas fa-lightbulb" | merge $iconMap -}}
|
|
{{- $iconMap = dict "success" "fas fa-check-circle" | merge $iconMap -}}
|
|
{{- $iconMap = dict "question" "fas fa-question-circle" | merge $iconMap -}}
|
|
{{- $iconMap = dict "warning" "fas fa-exclamation-triangle" | merge $iconMap -}}
|
|
{{- $iconMap = dict "failure" "fas fa-times-circle" | merge $iconMap -}}
|
|
{{- $iconMap = dict "danger" "fas fa-skull-crossbones" | merge $iconMap -}}
|
|
{{- $iconMap = dict "bug" "fas fa-bug" | merge $iconMap -}}
|
|
{{- $iconMap = dict "example" "fas fa-list-ol" | merge $iconMap -}}
|
|
{{- $iconMap = dict "quote" "fas fa-quote-right" | merge $iconMap -}}
|
|
{{- $iconDetails := "fas fa-angle-down" -}}
|
|
|
|
{{- if .IsNamedParams -}}
|
|
{{- $type := .Get "type" | default "note" -}}
|
|
{{- if .Get "details" -}}
|
|
<details class="admonition {{ $type }}">
|
|
<summary class="admonition-title">
|
|
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | default (T $type) }}<i class="details {{ $iconDetails }}"></i>
|
|
</summary>
|
|
<div class="admonition-content">
|
|
{{- $inner -}}
|
|
</div>
|
|
</details>
|
|
{{- else -}}
|
|
<div class="admonition {{ $type }}">
|
|
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | default (T $type) }}</p>
|
|
<div class="admonition-content">
|
|
{{- $inner -}}
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- $type := .Get 0 | default "note" -}}
|
|
{{- if .Get 2 -}}
|
|
<details class="admonition {{ $type }}">
|
|
<summary class="admonition-title">
|
|
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default (T $type) }}<i class="details {{ $iconDetails }}"></i>
|
|
</summary>
|
|
<div class="admonition-content">
|
|
{{- $inner -}}
|
|
</div>
|
|
</details>
|
|
{{- else -}}
|
|
<div class="admonition {{ $type }}">
|
|
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default (T $type) }}</p>
|
|
<div class="admonition-content">
|
|
{{- $inner -}}
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
{{- end -}}
|