From: Mark Otto Date: Tue, 14 Apr 2020 00:53:06 +0000 (-0700) Subject: Create a new table shortcode so we can easily add Bootstrap table classes to Markdown... X-Git-Tag: v5.0.0-alpha1~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85ac2fc35e60c430d5ba0342e584ba0a9b5b916e;p=thirdparty%2Fbootstrap.git Create a new table shortcode so we can easily add Bootstrap table classes to Markdown tables --- diff --git a/site/layouts/shortcodes/bs-table.html b/site/layouts/shortcodes/bs-table.html new file mode 100644 index 0000000000..6f972d6651 --- /dev/null +++ b/site/layouts/shortcodes/bs-table.html @@ -0,0 +1,11 @@ +{{- /* + Usage: `table "class"`, + where class can be anything +*/ -}} + +{{ $htmlTable := .Inner | markdownify }} +{{ $css_class := .Get 0 | default "table" }} +{{ $old := "" }} +{{ $new := printf "
" $css_class }} +{{ $htmlTable := replace $htmlTable $old $new }} +{{ $htmlTable | safeHTML }}