mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-18 15:54:26 +01:00
Create a new table shortcode so we can easily add Bootstrap table classes to Markdown tables
This commit is contained in:
parent
0408799ae5
commit
85ac2fc35e
11
site/layouts/shortcodes/bs-table.html
Normal file
11
site/layouts/shortcodes/bs-table.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{- /*
|
||||
Usage: `table "class"`,
|
||||
where class can be anything
|
||||
*/ -}}
|
||||
|
||||
{{ $htmlTable := .Inner | markdownify }}
|
||||
{{ $css_class := .Get 0 | default "table" }}
|
||||
{{ $old := "<table>" }}
|
||||
{{ $new := printf "<table class=\"%s\">" $css_class }}
|
||||
{{ $htmlTable := replace $htmlTable $old $new }}
|
||||
{{ $htmlTable | safeHTML }}
|
Loading…
x
Reference in New Issue
Block a user