Add support for rtl and ltr shortcodes (#293)

refer https://github.com/adityatelange/hugo-PaperMod/pull/293#issue-585979395 for usage guide and examples
This commit is contained in:
Mohammad Noor Abu Khleif 2021-03-22 13:17:40 +02:00 committed by GitHub
parent 306aa9fbfc
commit 80ad6ec2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -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>

View File

@ -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>