Add table formatting, requires using custom "table" shortcode

This commit is contained in:
2022-04-23 17:54:05 -05:00
parent f4c056b99c
commit 5ffca36b84
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,10 @@
{{/* See https://willschenk.com/articles/2020/styling_tables_with_hugo/ */}}
{{ $class := "markdown" }}
{{ with .Get "class" }}
{{ $class = delimit (slice $class .) " " }}
{{ end }}
{{ $htmlTable := .Inner | markdownify }}
{{ $new := printf `<table class="%s">` $class }}
{{ (replace $htmlTable "<table>" $new) | safeHTML }}