From 80ad6ec2a33082e8c0780e9a955bba7803eca2f4 Mon Sep 17 00:00:00 2001 From: Mohammad Noor Abu Khleif Date: Mon, 22 Mar 2021 13:17:40 +0200 Subject: [PATCH] Add support for `rtl` and `ltr` shortcodes (#293) refer https://github.com/adityatelange/hugo-PaperMod/pull/293#issue-585979395 for usage guide and examples --- layouts/shortcodes/ltr.html | 15 +++++++++++++++ layouts/shortcodes/rtl.html | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 layouts/shortcodes/ltr.html create mode 100644 layouts/shortcodes/rtl.html diff --git a/layouts/shortcodes/ltr.html b/layouts/shortcodes/ltr.html new file mode 100644 index 00000000..4ad7682b --- /dev/null +++ b/layouts/shortcodes/ltr.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +
+ {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +
diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html new file mode 100644 index 00000000..a69b8ce8 --- /dev/null +++ b/layouts/shortcodes/rtl.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +
+ {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +