paazca / wowchemy-rtl-module

A Hugo module which improves Wowchemy's support for right-to-left languages (such as Hebrew and Arabic) by converting the CSS using RTLCSS.
MIT License
0 stars 0 forks source link
academic hebrew hugo rtl wowchemy

wowchemy-rtl-module

A Hugo module in order to use Wowchemy with right-to-left languages (such as Hebrew and Arabic) by converting the CSS using RTLCSS.

Now with multilingual support! An LTR version can exist alongside an RTL version. This module will automatically create and use wowchemy-rtl.css for any RTL languages.

How to use

Note:

Using a different version of Wowchemy than the one this was built for may require you to copy layouts/partials/site_head.html from the Wowchemy repo and add the following code right after the line {{ $style := slice $css_bundle_head $style | resources.Concat "css/wowchemy.css" }}:

{{- $language_code := site.LanguageCode | default "en-us" -}}
{{- if in site.Data.i18n.rtl.rtl $language_code -}}
  {{- $style = slice $style | resources.Concat "css/wowchemy-rtl.css" | resources.PostCSS (dict "use" "rtlcss" "noMap" true) -}}
{{- end -}}