From d3cea2a5a81ab9fba65b0637561b806d5752a3c8 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Thu, 4 Apr 2024 11:00:47 -0700 Subject: [PATCH] Implement stub columns --- layouts/shortcodes/tomlToTable.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/layouts/shortcodes/tomlToTable.html b/layouts/shortcodes/tomlToTable.html index 23460a4d..bbe06808 100644 --- a/layouts/shortcodes/tomlToTable.html +++ b/layouts/shortcodes/tomlToTable.html @@ -10,7 +10,7 @@ widths = ["10%", "50%", "20%"] headerrows = 1 footer-rows = 3 -stub-columns = 1 +stubcolumns = 1 [[row]] column = [ @@ -61,7 +61,9 @@ {{ if (modBool $row_idx 2) }}{{- else }}{{- end }} {{- range $col_idx, $col := $row.column }} {{- $alignment := or (index $align $col_idx) "left" }} - + {{- $isStub := compare.Lt $col_idx $data.stubcolumns }} + {{- $class := cond $isStub "head stub" "head" }} + {{ $col | markdownify }} {{- end }} @@ -74,9 +76,14 @@ {{ if (modBool (add $row_idx $headerrows) 2) }}{{- else }}{{- end }} {{- range $col_idx, $col := $row.column }} {{- $alignment := or (index $align $col_idx) "left" }} - + {{- $isStub := compare.Lt $col_idx $data.stubcolumns }} + {{- if $isStub }} + + {{- else }} + + {{- end }} {{ $col | markdownify }} - + {{ cond $isStub "" "" | safeHTML }} {{- end }} {{- end }}