Skip to content

Commit

Permalink
Add support for rtl and ltr shortcodes (adityatelange#293)
Browse files Browse the repository at this point in the history
refer adityatelange#293 (comment) for usage guide and examples
  • Loading branch information
mohnoor94 authored Mar 22, 2021
1 parent 7b256ec commit 78a4e19
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions layouts/shortcodes/ltr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ $.Scratch.Set "md" false }}

{{ if .IsNamedParams }}
{{ $.Scratch.Set "md" (.Get "md") }}
{{ else }}
{{ $.Scratch.Set "md" (.Get 0) }}
{{ end }}

<div dir="ltr">
{{ if eq ($.Scratch.Get "md") false }}
{{ .Inner }}
{{ else }}
{{ .Inner | markdownify }}
{{ end }}
</div>
15 changes: 15 additions & 0 deletions layouts/shortcodes/rtl.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 78a4e19

Please sign in to comment.