Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write RTL text in Jekyll posts?

I want to set the default text direction for my Jekyll blog posts to right to left(RTL),

I usually used '<div dir="rtl">' in the beginning of the text to do this in Github markdown

but it seems I cannot use '<div dir="rtl">' in Jekyll markdown to set text direction correctly,

because my post gets all jammed up and will not display correctly.

Any suggestions?

like image 814
habedi Avatar asked Feb 04 '26 06:02

habedi


1 Answers

Override your theme layout (you can follow the instructions of https://jekyllrb.com/docs/themes/#overriding-theme-defaults) and then simply wrap the content tag with the desired div:

<div dir="rtl">
{{content}} 
</div>
like image 137
marcanuy Avatar answered Feb 05 '26 22:02

marcanuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!