Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.46 KB

README.md

File metadata and controls

27 lines (22 loc) · 1.46 KB

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