Skip to content

Commit

Permalink
Feat: Make HTML 'dir' configurable
Browse files Browse the repository at this point in the history
It helps RTL or hybrid languages.
  • Loading branch information
emranbm committed Feb 20, 2022
1 parent 228ff8d commit 2e4ef55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gh_sponsor: chrisrhymes
#hide_share_buttons: true
#theme_color: '#eeeeee'
#fixed_navbar: top
#direction: one of <ltr, rtl, auto>, default: ltr

paginate: 5
paginate_path: "/blog/page:num"
Expand Down
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{% endif %}

<html
dir="{{ site.direction | default: 'ltr' }}"
lang="{{ site.lang | default: 'en' }}"
{% if site.fixed_navbar %}class="has-navbar-fixed-{{ site.fixed_navbar }}"{% endif %}>
{% include head.html %}
Expand Down
6 changes: 5 additions & 1 deletion docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Below are some specific options that you might want to set in your `_config.yml`

The html lang attribute is set to `en` by default but you can override this in the _config.yml file `lang: en`

## Direction
The html _dir_ attribute is set to `ltr` by default. It can be overridden in the _config.yml file like `direction: rtl`.

## Google Analytics

To enable Google Analytics add `google_analytics: UA-xxxxxxxx` to your `_config.yml` replacing the UA-xxxxxxxx with your Google Analytics property.
Expand Down Expand Up @@ -54,4 +57,5 @@ Post comments are enabled by default if disqus is enabled. If you want to disabl

```markdown
comments: false
```
```

0 comments on commit 2e4ef55

Please sign in to comment.