#422, add support for column ratios in shortcode

This commit is contained in:
Alex Shpak
2024-10-04 13:36:14 +02:00
parent 925dbd3b9f
commit 9cc0b0225d
12 changed files with 108 additions and 186 deletions
+6 -4
View File
@@ -1,7 +1,9 @@
<div class="book-columns flex flex-wrap">
{{ range split .InnerDeindent "<--->" }}
<div class="flex-even markdown-inner">
{{ . | safeHTML }}
{{- $ratio := (split (.Get "ratio") ":") -}}
<div class="book-columns flex flex-wrap{{ with .Get "class" }} {{ . }}{{ end }}">
{{ range $index, $content := split .InnerDeindent "<--->" }}
{{- $grow := default 1 (index $ratio $index) -}}
<div class="flex-even markdown-inner" style="flex-grow: {{ $grow }};">
{{ $content | safeHTML }}
</div>
{{ end }}
</div>