aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-11-05 15:48:44 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-11-05 15:48:44 +0800
commit2517f748de42cb4babcc966a98cda7d6c36377ef (patch)
tree911ca24493c03495be9545b74594a108aeaa3b6e /layouts
parentb55831b3035a83543f421964212992f033a05e3c (diff)
feat(*): init admonition & refactor iconfont
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/admonition.html37
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