From 7e8fd8e38c8f81ec411b2c96c4dd5e47c123dd6c Mon Sep 17 00:00:00 2001 From: Thies Lennart Alff Date: Thu, 25 Aug 2022 14:22:01 +0200 Subject: [PATCH] vector battery table --- content/posts/vector3-battery.md | 13 +++++++++++++ layouts/shortcodes/table.html | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 content/posts/vector3-battery.md create mode 100644 layouts/shortcodes/table.html diff --git a/content/posts/vector3-battery.md b/content/posts/vector3-battery.md new file mode 100644 index 0000000..6ee1686 --- /dev/null +++ b/content/posts/vector3-battery.md @@ -0,0 +1,13 @@ +--- +title: Vector 3 Battery +date: 2022-08-25 +categories: ['Cycling'] +tags: ['cycling'] +--- + +{{% table %}} +| Date | Distance (km) | Time (h)| Lifetime (h) | +| ---- | ------------- | ------- | ------------ | +| 23.03.22 | 4073.5 | 163.4 | - | +| 25.08.22 | 7306.6 | 284.2 | 120.8 | +{{% /table %}} \ No newline at end of file diff --git a/layouts/shortcodes/table.html b/layouts/shortcodes/table.html new file mode 100644 index 0000000..c1991d9 --- /dev/null +++ b/layouts/shortcodes/table.html @@ -0,0 +1,6 @@ +{{ $htmlTable := .Inner | markdownify }} +{{ $class := .Get 0 }} +{{ $old := "" }} +{{ $new := printf "
" $class }} +{{ $htmlTable := replace $htmlTable $old $new }} +{{ $htmlTable | safeHTML }} \ No newline at end of file