summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/rtl.html
diff options
context:
space:
mode:
authorMohammad Noor Abu Khleif <moh.noor94@gmail.com>2021-03-22 13:17:40 +0200
committerGitHub <noreply@github.com>2021-03-22 16:47:40 +0530
commit80ad6ec2a33082e8c0780e9a955bba7803eca2f4 (patch)
tree7c69f2b444e0282db7503ca1e3ea43f53610a80b /layouts/shortcodes/rtl.html
parent306aa9fbfc9af725a1c1531cb0106917b725c8f5 (diff)
Add support for `rtl` and `ltr` shortcodes (#293)
refer https://github.com/adityatelange/hugo-PaperMod/pull/293#issue-585979395 for usage guide and examples
Diffstat (limited to 'layouts/shortcodes/rtl.html')
-rw-r--r--layouts/shortcodes/rtl.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html
new file mode 100644
index 0000000..a69b8ce
--- /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 }}
+
+<div dir="rtl">
+ {{ if eq ($.Scratch.Get "md") false }}
+ {{ .Inner }}
+ {{ else }}
+ {{ .Inner | markdownify }}
+ {{ end }}
+</div>