This repository has been archived on 2022-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
arsenm-dev-site/layouts/shortcodes/table.html

15 lines
596 B
HTML
Raw Permalink Normal View History

2021-01-31 08:54:37 +00:00
{{ $htmlTable := .Inner | markdownify }}
{{ $class := .Get 0 }}
{{ $old := "<table>" }}
{{ $new := printf "<table class=\"%s\">" $class }}
{{ $htmlTable := replace $htmlTable $old $new }}
{{ $old_item := "<td>" }}
{{ $old_thr := "<th>" }}
{{ $thr_class := "fw6 bb b--black-20 tl pb3 pr3 " }}
{{ $item_class := "pv3 pr3 bb b--black-20" }}
{{ $new_item := printf "<td class=\"%s\">" $item_class }}
{{ $new_thr := printf "<th class=\"%s\">" $thr_class }}
{{ $htmlTable := replace $htmlTable $old_item $new_item }}
{{ $htmlTable := replace $htmlTable $old_thr $new_thr }}
{{ $htmlTable | safeHTML }}