Skip to content

Commit

Permalink
Add support for rtl and ltr shortcodes (#293)
Browse files Browse the repository at this point in the history
refer adityatelange/hugo-PaperMod#293 (comment) for usage guide and examples
  • Loading branch information
patrickm68 committed Mar 22, 2021
1 parent ee901b3 commit 880c833
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 880c833

Please sign in to comment.