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

RTL (Right-to-Left) support for special languages as in Arabic, Persian, Hebrew, etc #253

Closed
Hitaro opened this issue Apr 17, 2020 · 4 comments

Comments

@Hitaro
Copy link

Hitaro commented Apr 17, 2020

  • Is there any official support for RTL?

  • Where should we put a rtl.css file? and how it should be pointed to in config file?

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 20, 2020

The template itself doesn't but it looks like it would be fairly straightforward to add with Hugo.

If you have Hugo 0.68.0 or later you can specify in your config file whether the language direction is rtl, like so:
https://gohugo.io/content-management/multilingual/#configure-languages

...and then check on that before including your CSS. The language direction param is very new so I haven't seen any examples yet....

The Docsy project CSS lives as SCSS files in /assets/scss/ - depending on how different you'd need the CSS to be for RTL, you could create a separate main-rtl.scss that includes any special versions of the subfiles you need for rtl styling, and then do the check for whether the current language is RTL in /layouts/partials/head-css.html

@LisaFC
Copy link
Collaborator

LisaFC commented Dec 11, 2020

We now have RTL support for Persian thanks to @theSinner, including RTL CSS! Please update if there's anything else you need - users will probably need to update the CSS to say they want to use the RTL styling for languages other than (fa)

Fixed in #379 (I think)

@LisaFC LisaFC closed this as completed Dec 11, 2020
@LisaFC LisaFC reopened this Dec 11, 2020
@theSinner
Copy link
Contributor

theSinner commented Dec 11, 2020

@LisaFC
Hi
Yes, I set the RTL styles just for the Persian language, because I had to specify lang.
I think it’s better to add other RTL languages to support all of them.
Based on this we have 8 RTL languages.
I will add them too in a particular PR.

@LisaFC
Copy link
Collaborator

LisaFC commented Dec 14, 2020

Fixed in #395! Great work!

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

No branches or pull requests

3 participants