bridgetownrb / bridgetown-slim

A Bridgetown plugin which provides support for Slim templates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bridgetown-slim

A Bridgetown plugin to provide support for Slim templates.

Installation for Bridgetown 1.2+

Run this command to add this plugin to your site's Gemfile:

$ bundle add bridgetown-slim

And then add the initializer to your configuration in config/initializers.rb:

init :"bridgetown-slim"

(For Bridgetown 1.1 or earlier, read these instructions.)

Usage

Simply name your page, layout, or partial with a .slim extension. The available features will be fairly analogous to the ERB support in Bridgetown, including support for helpers, partials, and rendering Liquid components. You can even embed Markdown and other template languages using standard Slim syntax.

You can also add template_engine: slim to your file's front matter and use any extension you want. For example, you could add data.xml to your source folder and simply make sure the front matter contains template_engine: slim.

Testing

  • Run bundle exec rspec to run the test suite
  • Or run script/cibuild to validate with Rubocop and test with rspec together.

Contributing

  1. Fork it (https://github.com/bridgetownrb/bridgetown-slim/fork)
  2. Clone the fork using git clone to your local development machine.
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

Examples

About

A Bridgetown plugin which provides support for Slim templates.

License:MIT License


Languages

Language:Ruby 93.1%Language:Shell 6.9%