al-folio
al-folio copied to clipboard
Right to left writting is now possible
This branch helps the template's internationalization by providing right-to-left (rtl) scripting.
The default
layout and all its derivates now automatically change their direction and alignment if a language with right-to-left scripting is specified in the front matter. The feature detects the following right-to-left languages (can be extended in _config.yml
):
- Arabic (ar)
- Aramaic (arc)
- Azeri (az)
- Dhivehi/Maldivian (dv)
- Hebrew (he)
- Kurdish (ku)
- Persian (fa)
- Urdu (ur)
An example post is also provided in the Blog.
The most recent push, fixes the location of the vertical line of blockquote with &
:
[dir=rtl] & {
border-right: 5px solid var(--global-theme-color);
border-left: none;
Note: It seems to me that the lateral border highlighting is repeated in _base.scss
. Namely, there's a command at line 41 and another one at the very end line 661. I'm not sure why is that. So, I added [dir=rtl] & {...
to both.
@arashgmn, thanks again for the implementation of rtl
support and for pushing a fix for the blockquote, it looks great! I'll take another pass, perhaps make some small adjustments to the code, and merge.
Happy to help. And thanks for the awesome template!
Also, we have a great font for writing Persian (Farsi)
called Vazirmatn
. It would be very good if we can somehow add custom fonts to this site. I'll just leave it as an idea.
Also, we have a great font for writing
Persian (Farsi)
calledVazirmatn
. It would be very good if we can somehow add custom fonts to this site. I'll just leave it as an idea.
In the same blog I posted earlier, I use Noto Naskh Arabic
(check _include/head.html
). It can be changed to Vazirmatn
easily.
The tricky part is to ensure ltr
and rtl
posts have the correct fonts. I used some layman's solutions to what didn'work, and it nearly works fine. The only exception is that the codes-block font is modified to the default ltr
font except mono
. This I couldn't fix, unfortunately. Would be happy to fix this one if you had any ideas.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any update on this? Should I modify anything?
I am not the best one to verify this, since I have no idea what are the rules when using left-to-right writing. @alshedivat @pourmand1376
Hi, I synced my fork to include the nice sidebar feature and adapted my repo. My new commits include the followings:
- Adding "Vazirmatn" font for
rtl
content, - ensuring the post-tags are always
ltr
(it looks better this way), - removing deprecated attributes defined for the earlier version,
- correct highlighting of the sidebar headers for active title or hover (by default, the vertical bar is placed on the right),
- ensuring that the code blocks are always
ltr
, left-aligned and inmonospace
.
In addition, I added one new post to demonstrate that the sidebar indeed works an rtl
language.
Cheers, Arash