Feat: add open and center params for details shortcode

This commit is contained in:
Cell
2024-07-21 00:59:05 +08:00
parent 9bacfa92f4
commit f6911c4fd2
+10 -3
View File
@@ -1,5 +1,12 @@
<details>
<summary>{{ .Get "summary" | default (.Get 0) | .Page.RenderString }}</summary>
{{- $summary := .Get "summary" | default (.Get 0) -}}
{{- $open := .Get "open" | default (.Get 1) | default false -}}
{{- $center := .Get "center" | default (.Get 2) | default false -}}
<details
{{- with $open }} open{{ end -}}
>
<summary
{{- if $center }} class="text-center"{{ end -}}
>{{ $summary | .Page.RenderString }}</summary>
{{ .Inner | .Page.RenderString }}
</details>
{{- /* EOF */ -}}
{{- /* EOF */ -}}