Giter VIP home page Giter VIP logo

wowchemy-rtl-module's Introduction

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

wowchemy-rtl-module's People

Contributors

paazca avatar

Watchers

 avatar

wowchemy-rtl-module's Issues

Could not use this module with wowchemy sponsor version

Thank you for making this module publicly available.

I tried using it with the repository personal website, where I added layouts/partials/site_head.html from site_head.html

However, I received number of errors (see below for the full message).
I tried to address the error

Hugo Chroma themes github-light.css and dracula.css not found in css/libs/chroma/

by calling hugo gen chromastyles but it did not work.

Full message after running hugo server

Start building sites โ€ฆ
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
ERROR 2022/06/19 10:46:38 Hugo Chroma themes github-light.css and dracula.css not found in css/libs/chroma/. See https://gohugo.io/commands/hugo_gen_chromastyles/
WARN 2022/06/19 10:46:38 Hugo cannot find a Widget Page at ar/home/index..md!
WARN 2022/06/19 10:46:38 If the page exists, Hugo Server may need restarting due to file changes.
WARN 2022/06/19 10:46:38 View the Widget Page documentation at https://wowchemy.com/docs/managing-content/#create-a-widget-page .
WARN 2022/06/19 10:46:38 If the Hugo version is between 0.65 and 0.68, it may be a confirmed Hugo bug that is expected to be fixed in Hugo v0.69: HugoBlox/hugo-blox-builder#1595 (comment) .
ERROR 2022/06/19 10:46:38 js.Build failed: Could not resolve "./wowchemy-utils"
ERROR 2022/06/19 10:46:38 js.Build failed: Could not resolve "./wowchemy-theming"
ERROR 2022/06/19 10:46:38 Hugo Chroma themes github-light.css and dracula.css not found in css/libs/chroma/. See https://gohugo.io/commands/hugo_gen_chromastyles/
ERROR 2022/06/19 10:46:38 js.Build failed: Could not resolve "./wowchemy-utils"
ERROR 2022/06/19 10:46:38 js.Build failed: Could not resolve "./wowchemy-theming"
WARN 2022/06/19 10:46:38 Hugo cannot find a Widget Page at home/index..md!
WARN 2022/06/19 10:46:38 If the page exists, Hugo Server may need restarting due to file changes.
WARN 2022/06/19 10:46:38 View the Widget Page documentation at https://wowchemy.com/docs/managing-content/#create-a-widget-page .
WARN 2022/06/19 10:46:38 If the Hugo version is between 0.65 and 0.68, it may be a confirmed Hugo bug that is expected to be fixed in Hugo v0.69: HugoBlox/hugo-blox-builder#1595 (comment) .
ERROR 2022/06/19 10:46:38 JSBUILD: failed to transform "en/js/wowchemy-bundle.js" (application/javascript): Could not resolve "./_vendor/medium-zoom.esm"
ERROR 2022/06/19 10:46:38 JSBUILD: failed to transform "js/wowchemy.js" (application/javascript): "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/wowchemy/wowchemy-hugo-modules/wowchemy/[email protected]/assets/js/wowchemy.js:9:25": No matching export in "ns-params:@params" for import "codeHighlighting"
ERROR 2022/06/19 10:46:38 JSBUILD: failed to transform "ar/js/wowchemy-bundle.js" (application/javascript): Could not resolve "./_vendor/medium-zoom.esm"
Error: Error building site: JSBUILD: failed to transform "js/wowchemy.js" (application/javascript): "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/wowchemy/wowchemy-hugo-modules/wowchemy/[email protected]/assets/js/wowchemy.js:9:25": No matching export in "ns-params:@params" for import "codeHighlighting"
Built in 262 ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.