aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes')
-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