diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-11-05 15:48:44 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-11-05 15:48:44 +0800 |
commit | 2517f748de42cb4babcc966a98cda7d6c36377ef (patch) | |
tree | 911ca24493c03495be9545b74594a108aeaa3b6e /layouts | |
parent | b55831b3035a83543f421964212992f033a05e3c (diff) |
feat(*): init admonition & refactor iconfont
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/admonition.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/layouts/shortcodes/admonition.html b/layouts/shortcodes/admonition.html new file mode 100644 index 0000000..fa5aacb --- /dev/null +++ b/layouts/shortcodes/admonition.html @@ -0,0 +1,37 @@ +{{ if .IsNamedParams -}} + + {{ if eq (.Get "details") "true" -}} + +<details class="admonition {{ .Get "type" }}"> + {{- with .Get "title" }}<summary class="admonition-title">{{ . }}</summary>{{ end }} + {{ .Inner }} +</details> + + {{- else -}} + +<div class="admonition {{ .Get "type" }}"> + {{- with .Get "title" }}<p class="admonition-title">{{ . }}</p>{{ end }} + {{ .Inner }} +</div> + + {{- end }} + +{{- else -}} + + {{ if eq (.Get 2) "true" -}} + +<details class="admonition {{ .Get 0 }}"> + {{- with .Get 1 }}<summary class="admonition-title">{{ . }}</summary>{{ end }} + {{ .Inner }} +</details> + + {{- else -}} + +<div class="admonition {{ .Get 0 }}"> + {{- with .Get 1 }}<p class="admonition-title">{{ . }}</p>{{ end }} + {{ .Inner }} +</div> + + {{- end }} + +{{- end }}
\ No newline at end of file |