Skip to content

Commit 17c465c

Browse files
zakariafcotes2020
andauthored
feat: dir is an optional attribute of html element
Co-authored-by: Cotes Chung <[email protected]> Signed-off-by: Zakaria Fatahi <[email protected]>
1 parent 6106083 commit 17c465c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

_layouts/default.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
{% endif %}
1414

1515
{% assign _lang_code = lang | split: '-' | first %}
16-
{% assign dir = 'ltr' %}
17-
{% if "ar,fa,he,iw,ps,ug,ur,yi,ku" contains _lang_code %}
18-
{% assign dir = 'rtl' %}
19-
{% endif %}
16+
17+
{%- capture dir -%}
18+
{%- if 'ar,fa,he,iw,ps,ug,ur,yi,ku' contains _lang_code -%}
19+
dir="rtl"
20+
{%- endif -%}
21+
{%- endcapture -%}
2022

2123
<!-- `lang` attribute is set in _includes/lang.html -->
22-
<html lang="{{ lang }}" dir="{{ dir }}" {{ prefer_mode }}>
24+
<html lang="{{ lang }}" {{ dir }} {{ prefer_mode }}>
2325
{% include head.html %}
2426

2527
<body>

0 commit comments

Comments
 (0)