{{- /* Custom table render hook for FixIt theme. - Wraps tables in a scrollable container - Supports auto-numbering via CSS counters (config: params.table.number) - Supports client-side sorting (config: params.table.sort) - Supports table captions via Markdown attribute {caption="..."} - Per-table override via Markdown attributes (e.g., {number=false, sort=false}) See https://gohugo.io/render-hooks/tables/ */ -}} {{- $pageConfig := dict "Page" .Page "Key" "table" | partial "function/param.html" | merge .Attributes -}} {{- $config := .Attributes | merge $pageConfig -}} {{- $caption := .Attributes.caption -}} {{- $attrs := "" -}} {{- if $config.number }} {{- $attrs = printf "%s data-table-numbered" $attrs }} {{- end -}} {{- if $config.sort }} {{- $attrs = printf "%s data-sortable" $attrs }} {{- .Page.Store.Set "hasTableSort" true }} {{- end -}} {{- range $k, $v := .Attributes }} {{- if and $v (ne $k "number") (ne $k "caption") (ne $k "sort") }} {{- $attrs = printf "%s %s=%q" $attrs $k $v }} {{- end }} {{- end -}} {{- $attrs = partial "function/trim.html" $attrs -}}
{{- if or $config.number $caption }} {{- end -}} {{- range .THead }} {{- range . }} {{- end }} {{- end }} {{- range .TBody }} {{- range . }} {{- end }} {{- end }}
{{- if $config.number }}{{ end -}} {{- with $caption }}{{ . }}{{ end -}}
{{- .Text -}}
{{- .Text -}}
{{- /* EOF */ -}}