From e3c30b4e41e046c76402bce55233598ee01bb543 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 8 Jul 2022 20:09:18 +0530 Subject: [PATCH] Add inTextImg shortcode Allows adding in-line-text images usage in page.md => This image is inlined {{< inTextImg.html url="image.png" >}} here. optional args: - height - alt --- assets/css/common/post-single.css | 5 +++++ layouts/shortcodes/inTextImg.html | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 layouts/shortcodes/inTextImg.html diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css index 029e2155..0f569bf5 100644 --- a/assets/css/common/post-single.css +++ b/assets/css/common/post-single.css @@ -393,4 +393,9 @@ h6:hover .anchor { h1>a>svg { display: inline; +} + +img.in-text { + display: inline; + margin: auto; } \ No newline at end of file diff --git a/layouts/shortcodes/inTextImg.html b/layouts/shortcodes/inTextImg.html new file mode 100644 index 00000000..5e6d84d6 --- /dev/null +++ b/layouts/shortcodes/inTextImg.html @@ -0,0 +1,5 @@ +{{- $Img := (.Get "url") }} +{{- $height := (.Get "height") }} +{{- $alt := (.Get "alt") }} + +{{$alt}} \ No newline at end of file