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 #293

Merged
merged 2 commits into from
Mar 22, 2021
Merged

Add support for rtl and ltr shortcodes #293

merged 2 commits into from
Mar 22, 2021

Conversation

mohnoor94
Copy link
Contributor

@mohnoor94 mohnoor94 commented Mar 6, 2021

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 md by default.
  • If you want to include sub-shortcodes, you can set the md parameter to false.

Examples:

{{< rtl >}}

> مرحبا بك

{{< /rtl >}}

This will result in rtl contents rendered using md.


{{< rtl md=false >}}
{{< blockquote >}}

مرحبا بك

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

This will result in a blockquote in rtl.


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

مرحبا بك

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

This will result in a blockquote in rtl (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.

Copy link
Owner

@adityatelange adityatelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohnoor94 This seems good, can we have a slight change here, let the content be markdown enabled by default and pass the md=false param to disable it ?

@sonarcloud
Copy link

sonarcloud bot commented Mar 19, 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
0.0% 0.0% Duplication

@mohnoor94
Copy link
Contributor Author

@mohnoor94 This seems good, can we have a slight change here, let the content be markdown enabled by default and pass the md=false param to disable it ?

I was thinking about the same tbh. Updated 👍🏼

Copy link
Owner

@adityatelange adityatelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !

@adityatelange adityatelange merged commit 80ad6ec into adityatelange:master Mar 22, 2021
@mohnoor94 mohnoor94 deleted the rtl-ltr branch March 22, 2021 19:50
patrickm68 added a commit to patrickm68/hugo-PaperMod that referenced this pull request May 5, 2022
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants