Jekyll Opal

screenshot of Jekyll Opal

Let Jekyll convert your Ruby into JavaScript using Opal

Overview

Jekyll-Opal is a powerful tool that enables developers to seamlessly convert Ruby code into JavaScript using the Opal compiler. This plugin is particularly useful for those who want to leverage the strengths of both languages in their Jekyll-powered websites. With Jekyll-Opal, you can enhance your applications by writing your Opal code in .opal files, making the process both straightforward and efficient.

By incorporating this functionality into your Jekyll site, you gain the flexibility to manage assets and write dynamic functionality in Ruby, which will be automatically converted to JavaScript. This integration not only streamlines your development process but also allows for a more structured codebase.

Features

  • Easy Integration: Simply add Jekyll-Opal to your Gemfile and follow the straightforward installation steps to get started.

  • Opal File Support: Write your scripts in .opal files, ensuring to include the necessary header lines for proper page generation.

  • Automatic Library Generation: The plugin generates the Opal library file automatically, so you don’t need to manage this manually, reducing setup time.

  • Dynamic URL Handling: Utilize the {{ site.opal.url }} variable to output URLs for your JavaScript file dynamically, simplifying site management, especially in subfolder setups.

  • Liquid Filter Compatibility: Chain variables using Liquid filters to configure URLs or other dynamic content, enhancing the flexibility of your site.

  • Community Contributions: Easily contribute to the project by forking the repository, making changes, and submitting a pull request to enhance the tool for all users.

  • MIT License: The plugin is freely available under the MIT license, allowing for personal and commercial use without restrictions.