If the page is in Persian (or Arabic), you indeed have to specify it on the frontmatter by
lang: fa # or "ar" if Arabic
Then, you can combine it with @marcanuy 's suggestion by making an if/else statement, probably in your base layout file (look in your _layouts
folder for something like default.html
or base.html
) like the following:
{%- if page.lang == 'fa' -%}
<div class="root" data-is-touch="false" dir="rtl">
{{content}}
</div>
{%- else -%}
<div class="root" data-is-touch="false">
{{content}}
</div>
{%- endif -%}
NOTE: My div
properties, <div class="root" data-is-touch="false">
depend on my template and yours could be anything else. The point, however, is the extra property which will be added if the condition of the if-statement is fulfilled.