#791, bring back missing ID for columns to apply ratio

This commit is contained in:
Alex Shpak
2026-01-08 12:17:51 +01:00
parent b7f9c8cb0f
commit 81a841c92d
+9 -4
View File
@@ -5,6 +5,7 @@
"attributes" (cond .IsNamedParams .Params dict)
"merge" (dict
"class" (slice "book-columns" "flex" "flex-wrap")
"id" (printf "book-columns-%d" .Ordinal)
)
) -}}
<div {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>
@@ -16,15 +17,19 @@
{{- end -}}
</div>
{{- else -}}
{{- if .Get "ratio" -}}<style>{{- range $index, $grow := $ratio -}}
.book-columns-{{ $.Ordinal }}>ul>li:nth-child({{ $index | add 1 }}){
{{- if .Get "ratio" -}}
<style>{{- range $index, $grow := $ratio -}}
#book-columns-{{ $.Ordinal }}>ul>li:nth-child({{ $index | add 1 }}) {
flex-grow: {{ default 1 $grow }};
}
{{- end -}}</style>{{- end -}}
}
{{ end -}}
</style>
{{- end -}}
{{- $attributes := partial "docs/text/mapper" (dict
"attributes" (cond .IsNamedParams .Params dict)
"merge" (dict
"class" (slice "book-columns")
"id" (printf "book-columns-%d" .Ordinal)
)
) -}}
<div {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>