Skip to content

A Hugo module which improves Wowchemy's support for right-to-left languages (such as Hebrew and Arabic) by converting the CSS using RTLCSS.

License

Notifications You must be signed in to change notification settings

paazca/wowchemy-rtl-module

Repository files navigation

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

  • Add to config/_default/config.toml (make sure it's imported before wowchemy):

    [module]
      [[module.imports]]
        path = "github.com/paazca/wowchemy-rtl-module"
  • Install Node.js

  • Run hugo mod npm pack in order to create a consolidated package.json for installing the npm dependencies.

  • Run npm install to install the npm dependencies.

  • Additional CSS modifications for RTL languages can be added to assets/scss/wowchemy/layouts/_rtl.scss.

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 -}}

About

A Hugo module which improves Wowchemy's support for right-to-left languages (such as Hebrew and Arabic) by converting the CSS using RTLCSS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published