Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rtl and ltr shortcodes #291

Closed
wants to merge 2 commits into from
Closed

Add support for rtl and ltr shortcodes #291

wants to merge 2 commits into from

Conversation

mohnoor94
Copy link
Contributor

This is to support rtl and ltr short-codes.

Use Case:

You may need to insert some contents in a different direction compared to your main site direction so that these shortcodes will come in handy.

Important notes:

  • These shortcodes will support nested shortcodes by default so that they won't markdownify your contents!
  • If you want to markdownify (support md in) your contents, you can set the md parameter to true.

Examples:

{{< rtl >}}
{{< blockquote >}}

مرحبا بك

{{< /blockquote >}}
{{< /rtl >}}

This will result in a blockquote in rtl.


{{< rtl md=true >}}

> مرحبا بك

{{< /rtl >}}

This will result in rtl contents which rendered using md.


{{< rtl true >}}

> مرحبا بك

{{< /rtl }}

This will result in rtl contents which rendered using md (same example above, but with positional argument instead of a named argument in the content file).


The ltr shortcode could be used in the same way but in the context of an rtl website.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mohnoor94
Copy link
Contributor Author

Replaced by #293

@mohnoor94 mohnoor94 closed this Mar 6, 2021
@adityatelange adityatelange added the duplicate This issue or pull request already exists label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants