Skip to content

Commit

Permalink
🆕 💄 layouts(shortcodes): Create table layout (#70)
Browse files Browse the repository at this point in the history
Shortcode for a table used in unicef/inventory#125.
  • Loading branch information
abbycabs authored Mar 14, 2022
1 parent c4ed224 commit 2db593c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions layouts/shortcodes/table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ $_hugo_config := `{ "version": 1 }` }}

{{ $htmlTable := .Inner | markdownify }}
{{ $class := .Get 0 }}
{{ $old := "<table>" }}
{{ $new := printf "<table class=\"%s\">" $class }}
{{ $htmlTable := replace $htmlTable $old $new }}
{{ $htmlTable | safeHTML }}

0 comments on commit 2db593c

Please sign in to comment.